Skip to content

Latest commit

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

thencrypt

An easy-to-use encryption module based on Crypto.

Installation

npm install thencrypt

Usage

importthencryptfrom'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();

License

The thencrypt package is licensed under the Apache 2.0 license. More can be found in LICENSE

About

An easy-to-use encryption module based on Crypto.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages