0.6.4 • Published 10 months ago

@lemonldap-ng/crypto v0.6.4

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
10 months ago

@lemonldap-ng/crypto

@lemonldap-ng/crypto provide encrypt/decrypt methods used by LemonLDAP::NG system.

This library is compatible with LemonLDAP::NG >= 2.0.5.

Usage:

import Crypto from '@lemonldap-ng/crypto`;
import {expect} from 'expect';
// or with expect < 28
import expect from 'expect';

const encrypter = new Crypto(key); // key is an ascii string, the real key is sha256(key)

let encryptedString = encrypter.encrypt(data);

let decryptedString = encrypter.decrypt(encryptedString);

expect(decryptedString).toEqual(data)

@lemonldap-ng/conf-cdbi is a component of lemonldap-ng-handler, a Node.js handler for LemonLDAP::NG WebSSO.