You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
543 B
32 lines
543 B
var mockHex = '0xabcdef0123456789'
|
|
var mockKey = new Buffer(32)
|
|
let cacheVal
|
|
|
|
module.exports = {
|
|
|
|
encrypt(password, dataObj) {
|
|
cacheVal = dataObj
|
|
return Promise.resolve(mockHex)
|
|
},
|
|
|
|
decrypt(password, text) {
|
|
return Promise.resolve(cacheVal || {})
|
|
},
|
|
|
|
encryptWithKey(key, dataObj) {
|
|
return this.encrypt(key, dataObj)
|
|
},
|
|
|
|
decryptWithKey(key, text) {
|
|
return this.decrypt(key, text)
|
|
},
|
|
|
|
keyFromPassword(password) {
|
|
return Promise.resolve(mockKey)
|
|
},
|
|
|
|
generateSalt() {
|
|
return 'WHADDASALT!'
|
|
},
|
|
|
|
}
|
|
|