示例#1
0
exports.signAndEncryptData = function(passphrase, plaintext, recipient_public_key, keystore) {
    var key_str = sjcl.decrypt(passphrase, keystore );
    var RSAKey = cryptico.rsa_key_from_string(key_str);
    return cryptico.encrypt(plaintext, recipiant_public_key, RSAKey);
}
示例#2
0
exports.decryptData = function(passphrase, cipherText, keystore) {
    var key_str = sjcl.decrypt(passphrase, keystore );
    var RSAKey = cryptico.rsa_key_from_string(key_str);
    return cryptico.decrypt(cipherText, RSAKey);
}