Facebook Conceal and RSA utilities for js
Compatible with Facebook Conceal 2.0
Usage
Conceal
const Conceal = ;const conceal = 'my-password'; // orconst conceal = 'my-password' myKey encoding;// encoding: hex or base64// myKey: 32 bytes with ${encoding} encoded string
String
const plain = 'hello world @ 2020';const encrypted = conceal;const decrypted = conceal;
File
const srcFilePath = 'test/xxy007.png';const encFilePath = 'test/xxy007.png.enc';const decFilePath = 'test/xxy007.dec.png'; conceal ;
Using in browser
RSA
const Rsa = ; const privateKey = fs;const publicKey = fs; const rsa = rsaPrivateKey rsaPublicKey 'base64'; const plain = 'hello world @ 2020';const signed = rsa;const verified = rsa;const encrypted = rsa;const decrypted = rsa;
FAQ
Private Key
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in pkcs1.key -out pkcs8.key