Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 747 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 747 Bytes

emip3js

emip3js is a javascript implementation of EmIP-003.

Usage

Encryption

import {encryptWithPassword, decryptWithPassword} from 'emip3js';

const passwordHex = Buffer.from('password', 'utf8').toString('hex');
const saltHex = '50515253c0c1c2c3c4c5c6c750515253c0c1c2c3c4c5c6c750515253c0c1c2c3'; // 32-byte hex string
const nonceHex = '50515253c0c1c2c3c4c5c6c7'; // 12-byte hex string
const dataHex = Buffer.from('some data to encrypt', 'utf8').toString('hex');

const ciphertextHex = await encryptWithPassword(passwordHex, saltHex, nonceHex, dataHex);

Decryption

const decryptedDataHex = await decryptWithPassword(passwordHex, ciphertextHex);