mirror of https://github.com/lukechilds/Agama.git
Browse Source
Existing encryption used an insufficient key strenght and had no authentication. We now derive the key from 300,000 rounds of PBKDF2, encrypt with AES-CBC and authenticate data integrity with a SHA-256 HMAC.encryption
Luke Childs
7 years ago
4 changed files with 24 additions and 17 deletions
@ -0,0 +1,11 @@ |
|||
'use strict'; |
|||
const {createSession} = require('iocane'); |
|||
|
|||
const session = createSession() |
|||
.use('cbc') |
|||
.setDerivationRounds(300000); |
|||
|
|||
module.exports = { |
|||
encrypt: session.encrypt.bind(session), |
|||
decrypt: session.decrypt.bind(session), |
|||
}; |
Loading…
Reference in new issue