object_cryptor
v0.0.2
Published
Object encryptor decryptor using aes192. It converts any object to a base64 encrypted string, and the oposite. Objects are first converted to JSON, don't expect functions to be converted.
Downloads
2
Readme
Object encryptor decryptor using aes192. It converts any object to a base64 encrypted string, and the oposite from an encrypted base64 string to an object. Note that objects are first converted to JSON, don't expect functions to be converted.
Example:
c=require('object_cryptor');
c1=c(''abcdefghijklmnopqrstuvxyz');
var obj = {
a: 'a',
'one': 1,
'sub': {
'two': 2,
'three': 'three'
}
}
c1.encrypt(obj);
// 'VZE/AoEbgIzaOAKeBTp5523SfXKEGchfw1dLHTzs2dJRz9u4DxfICGfpxqaRwgc/WsBZj4igPHdxF1BTlsS+Vg=='
c1.decrypt('VZE/AoEbgIzaOAKeBTp5523SfXKEGchfw1dLHTzs2dJRz9u4DxfICGfpxqaRwgc/WsBZj4igPHdxF1BTlsS+Vg==')
// { a: 'a', one: 1, sub: { two: 2, three: 'three' } }