An easy-to-use encryption module based on Crypto.
npm install thencryptimportthencryptfrom'thencrypt';interfaceEncryptor{encrypt(text: string): Promise<string>;decrypt(encryptedText: string): Promise<string>;}asyncfunctiondokuzKey(): Promise<void>{constsecretKey: string='SECRET_KEY';constencryptor: Encryptor=newthencrypt(secretKey);consttext: string='I love musti!';try{constencrypted: string=awaitencryptor.encrypt(text);console.log('Encrypted data: ',encrypted);constdecrypted: string=awaitencryptor.decrypt(encrypted);console.log('Decrypted data: ',decrypted);}catch(error){console.error('Encryption error: ',error);}}dokuzKey();The thencrypt package is licensed under the Apache 2.0 license. More can be found in LICENSE