https://github.com/hex2f/rekrypt
Bad encryption module.
https://github.com/hex2f/rekrypt
Last synced: 12 months ago
JSON representation
Bad encryption module.
- Host: GitHub
- URL: https://github.com/hex2f/rekrypt
- Owner: hex2f
- Created: 2017-02-06T12:07:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-06T18:36:24.000Z (over 9 years ago)
- Last Synced: 2025-03-27T11:19:52.385Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

Installation
---------------------
###NPM:
```
npm i rekrypt --save
```
Documentation
---------------------
###Basic Usage
```javascript
//Import Rekrypt
const rekrypt = require('rekrypt');
//Basic Encryption
//Encrypt takes 3 arguments. 2 of which are optional:
//encrypt('String', 'Key', Timestamp)
var encrypted = rekrypt.encrypt('Hello World!');
//This returns ['Encrypted String', 'key', Timestamp]
//Basic Decryption
//Decrypt takes the same arguments as encrypt
//But the string is the one we want to decrypt.
var decrypted = rekrypt.decrypt(encrypted[0],encrypted[1]);
//Here encrypted[0] is the encrypted string
//And encrypted[1] is the key used to decrypt the message.
console.log(`Encrypted Array: ${encrypted}`);
console.log(`Decrypted String: ${decrypted}`);
```
###Syntax
```javascript
encrypt( "String To Encrypt", "Optional Key", Optional Timestamp );
Returns ["Encrypted String", "Encryption Key Used", Timestamp]
```
```javascript
decrypt( "String To Decrypt", "Encryption Key", Optional Timestamp );
Returns "Decrypted String"
```
```javascript
makekey( length );
Returns "Base64 String"
```