密钥管理 - 经典 ASP - 加密/解密
这是我的场景:
我有一个名为 gen.asp 的文件,当有人请求该文件时,它需要生成一个加密的随机密钥并将其传回。 (Gen.asp 无法存储它生成的密钥,任何地方都没有会话,没有数据库)
我有一个名为 GenValid.asp 的不同文件,在这个文件中我需要验证加密随机密钥是否由 Gen.asp 生成或不是。 (验证可以是,如果加密的随机密钥可以被解密,那么它是一个有效的密钥,如果不能,它不是一个有效的密钥)
我该怎么做?在经典 ASP 中。
Here is my scenario:
I have file called gen.asp, when ever someone requests this file It needs to generate a encrypted-random-key and pass it back. (Gen.asp can not store the key it generated, anywhere no session, no database)
I have a different file called GenValid.asp, in this file I need to verify weather the encrypted-random-key is generated by Gen.asp or not. (validation can be if the encrypted-random-key can be decrypted then it's a valid key, if not it's not a valid key)
How can I do this? in Classic ASP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让 GenValid.asp 有一个 RSA1024 私钥-公钥对。在 gen.asp 末尾具有与 GenValid.asp 关联的公钥。
当 gen.asp 生成会话密钥时,让该会话密钥被 GenValid.asp 的公钥包装/blob-ed。
当此包装的会话密钥到达 GenValid.asp 时,它可以单独解开会话密钥(使用其 RSA1024 私钥)以进一步使用此密钥。
Let GenValid.asp have a RSA1024 Private-Public key pair. Have the public key associated with GenValid.asp at gen.asp end.
When gen.asp generates the session key, let this session key be wrapped/blob-ed by GenValid.asp's public key.
When this wrapped session key reaches GenValid.asp, it alone can unwrap the session key (using its RSA1024 Private key) for further usage of this key.