2016-10-21 21:11:54 +02:00
|
|
|
var mockHex = '0xabcdef0123456789'
|
|
|
|
var mockKey = new Buffer(32)
|
|
|
|
let cacheVal
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
encrypt (password, dataObj) {
|
2016-10-21 21:11:54 +02:00
|
|
|
cacheVal = dataObj
|
|
|
|
return Promise.resolve(mockHex)
|
|
|
|
},
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
decrypt (password, text) {
|
2016-10-21 21:11:54 +02:00
|
|
|
return Promise.resolve(cacheVal || {})
|
|
|
|
},
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
encryptWithKey (key, dataObj) {
|
2016-10-21 21:11:54 +02:00
|
|
|
return this.encrypt(key, dataObj)
|
|
|
|
},
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
decryptWithKey (key, text) {
|
2016-10-21 21:11:54 +02:00
|
|
|
return this.decrypt(key, text)
|
|
|
|
},
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
keyFromPassword (password) {
|
2016-10-21 21:11:54 +02:00
|
|
|
return Promise.resolve(mockKey)
|
|
|
|
},
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
generateSalt () {
|
2016-10-21 21:11:54 +02:00
|
|
|
return 'WHADDASALT!'
|
|
|
|
},
|
|
|
|
|
2017-09-25 23:45:28 +02:00
|
|
|
getRandomValues () {
|
|
|
|
return 'SOO RANDO!!!1'
|
2018-07-03 00:49:33 +02:00
|
|
|
},
|
2017-09-25 23:45:28 +02:00
|
|
|
|
2016-10-21 21:11:54 +02:00
|
|
|
}
|