UNPKG

passy

Version:

An offline password manager stored locally with CLI interaction

1 lines 3.61 kB
const a0_0x2010e9=a0_0x3c2a;function a0_0x272e(){const _0x36122f=['from','948786DRqbzn','8rbOivm','1718268eeLgAv','Decryption\x20failed:\x20','10elHNTs','8mHdMav','final','exports','94245cRlycd','FjJTa','aes-256-cbc','cPDfw','createCipheriv','QapVg','bGySB','VIJoz','6672qOjamN','concat','50083aVPKDn','20VStoIq','1286154CLeMDm','update','utf8','2827482UErbYa','PGYxe','hex','CTzwB','916425aVXKXp','randomBytes','toString','Sujvr','message'];a0_0x272e=function(){return _0x36122f;};return a0_0x272e();}(function(_0x16c226,_0x5911ba){const _0x255f64=a0_0x3c2a,_0x4db1f8=_0x16c226();while(!![]){try{const _0x3deee2=-parseInt(_0x255f64(0xdf))/0x1*(parseInt(_0x255f64(0xd8))/0x2)+-parseInt(_0x255f64(0xca))/0x3+-parseInt(_0x255f64(0xd9))/0x4+-parseInt(_0x255f64(0xea))/0x5*(parseInt(_0x255f64(0xd7))/0x6)+parseInt(_0x255f64(0xcd))/0x7*(-parseInt(_0x255f64(0xdc))/0x8)+parseInt(_0x255f64(0xd1))/0x9*(parseInt(_0x255f64(0xdb))/0xa)+parseInt(_0x255f64(0xe9))/0xb*(parseInt(_0x255f64(0xe7))/0xc);if(_0x3deee2===_0x5911ba)break;else _0x4db1f8['push'](_0x4db1f8['shift']());}catch(_0x2e1053){_0x4db1f8['push'](_0x4db1f8['shift']());}}}(a0_0x272e,0x5846a));function a0_0x3c2a(_0x22c3bc,_0x460df9){const _0x272e7f=a0_0x272e();return a0_0x3c2a=function(_0x3c2a43,_0x30c84c){_0x3c2a43=_0x3c2a43-0xca;let _0x427ac7=_0x272e7f[_0x3c2a43];return _0x427ac7;},a0_0x3c2a(_0x22c3bc,_0x460df9);}const crypto=require('crypto'),ALGORITHM=a0_0x2010e9(0xe1),SALT_LENGTH=0x10,KEY_LENGTH=0x20,generateSalt=()=>crypto[a0_0x2010e9(0xd2)](SALT_LENGTH)[a0_0x2010e9(0xd3)](a0_0x2010e9(0xcf)),deriveKey=(_0x1d42c6,_0xaea219)=>crypto['scryptSync'](_0x1d42c6,_0xaea219,KEY_LENGTH),encrypt=(_0x36583f,_0xc3e55a)=>{const _0x65fb61=a0_0x2010e9,_0x1af9ed={'CTzwB':function(_0x5c57f8){return _0x5c57f8();},'bGySB':function(_0x4eab22,_0x42fa6a,_0x54a619){return _0x4eab22(_0x42fa6a,_0x54a619);},'QapVg':_0x65fb61(0xcf),'AjgQU':function(_0x140aa9,_0x9bd3fb){return _0x140aa9!==_0x9bd3fb;}};try{const _0x88ef4=_0x1af9ed[_0x65fb61(0xd0)](generateSalt),_0x5d2fc2=crypto[_0x65fb61(0xd2)](0x10),_0x2e4e80=_0x1af9ed[_0x65fb61(0xe5)](deriveKey,_0xc3e55a,_0x88ef4),_0x29f24f=crypto[_0x65fb61(0xe3)](ALGORITHM,_0x2e4e80,_0x5d2fc2),_0x2b4974=Buffer['concat']([_0x29f24f[_0x65fb61(0xcb)](_0x36583f,_0x65fb61(0xcc)),_0x29f24f['final']()]);return _0x88ef4+':'+_0x5d2fc2[_0x65fb61(0xd3)](_0x1af9ed[_0x65fb61(0xe4)])+':'+_0x2b4974[_0x65fb61(0xd3)](_0x1af9ed['QapVg']);}catch(_0x3535f1){if(_0x1af9ed['AjgQU'](_0x65fb61(0xce),_0x65fb61(0xce)))throw new _0x3d8657('Encryption\x20failed:\x20'+_0x3f476d['message']);else throw new Error('Encryption\x20failed:\x20'+_0x3535f1[_0x65fb61(0xd5)]);}},decrypt=(_0x33e5f3,_0xe305ac)=>{const _0x385bc2=a0_0x2010e9,_0x24eb93={'FjJTa':'Invalid\x20encrypted\x20format','Sujvr':'hex','VIJoz':function(_0x5123b8,_0x143df0,_0x475560){return _0x5123b8(_0x143df0,_0x475560);},'cPDfw':_0x385bc2(0xcc)};try{const [_0x162eba,_0x2ceae9,_0x49f0f1]=_0x33e5f3['split'](':');if(!_0x162eba||!_0x2ceae9||!_0x49f0f1)throw new Error(_0x24eb93[_0x385bc2(0xe0)]);const _0x27b1a9=Buffer['from'](_0x2ceae9,_0x24eb93[_0x385bc2(0xd4)]),_0x30b15a=Buffer[_0x385bc2(0xd6)](_0x49f0f1,_0x24eb93[_0x385bc2(0xd4)]),_0x5bae8c=_0x24eb93[_0x385bc2(0xe6)](deriveKey,_0xe305ac,_0x162eba),_0x566f82=crypto['createDecipheriv'](ALGORITHM,_0x5bae8c,_0x27b1a9),_0x424f40=Buffer[_0x385bc2(0xe8)]([_0x566f82[_0x385bc2(0xcb)](_0x30b15a),_0x566f82[_0x385bc2(0xdd)]()]);return _0x424f40[_0x385bc2(0xd3)](_0x24eb93[_0x385bc2(0xe2)]);}catch(_0x3840c6){throw new Error(_0x385bc2(0xda)+_0x3840c6[_0x385bc2(0xd5)]);}};module[a0_0x2010e9(0xde)]={'encrypt':encrypt,'decrypt':decrypt};