An open API service indexing awesome lists of open source software.

https://github.com/mackentoch/easycrypt


https://github.com/mackentoch/easycrypt

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

easyCrypt
====

Attempt to use forge RC2 crypt.

## How to

#### declare
needs in your html :

```html

```

#### use

*both encrypt / decrypt*
```javascript
var demoKey = 'somethingsuperhugeandsupersecret';
var demoIV = 'vector';
```

*encrypt*
```javascript
// in your javascript
var MESSAGE_TO_CRYPT = 'to crypt';
var encryptedValue = easyCrypt
.setRawMessage(MESSAGE_TO_CRYPT
.getEncrypted({key: demoKey, iv: demoIV});
console.log('encryptedValue value: ', encryptedValue);
```

*decrypt*
```javascript
// in your javascript
var CRYPTED_MESSAGE_WITH_SAME_KEYS = 'ZmJkM2I1NzNiOWZlZjkzNzI1ZDczN2M1Nzk5MGI5Zjg==';
var decryptedValue = easyCrypt
.getDecrypted(CRYPTED_MESSAGE_WITH_SAME_KEYS, {key: demoKey, iv: demoIV});
console.log('decrypted value: ', decryptedValue);
```