This commit is contained in:
2025-02-19 00:34:51 +08:00
parent cf1cc83547
commit 2f3ffe2a34
33 changed files with 3180 additions and 832 deletions

View File

@@ -19,21 +19,21 @@ class Rsa {
}
// 公钥加密
PublicKeyEncryption(text) {
return (new NodeRsa(this.public_key)).encrypt(JSON.stringify(text), 'base64')
}
// // 公钥加密
// PublicKeyEncryption(text) {
// return (new NodeRsa(this.public_key)).encrypt(JSON.stringify(text), 'base64')
// }
// 公钥解密
PublicKeyDecryption(text) {
return JSON.parse((new NodeRsa(this.public_key)).decryptPublic(text, 'utf8'))
}
// // 公钥解密
// PublicKeyDecryption(text) {
// return JSON.parse((new NodeRsa(this.public_key)).decryptPublic(text, 'utf8'))
// }
// 私钥加密
PrivateKeyEncryption(text) {
return (new NodeRsa(this.private_key)).encryptPrivate(JSON.stringify(text), 'base64')
}
// // 私钥加密
// PrivateKeyEncryption(text) {
// return (new NodeRsa(this.private_key)).encryptPrivate(JSON.stringify(text), 'base64')
// }
// 私钥解密
PrivateKeyDecryption(text) {