コード例 #1
0
AuthKey.encryptAuthKey = function (authKey, password) {
    var plainKey = Buffer.concat([authKey.id, authKey.value]);
    var passwordHash = utility.createSHAHash(new Buffer(password), 'sha512');
    var aesKey = passwordHash.slice(0, 32);
    var aesIv = passwordHash.slice(32, 64);
    return security.cipher.aesEncrypt(plainKey, aesKey, aesIv).slice(0);
};