Crypto building blocks.
$ npm i @stellar-fox/cryptops
- play in your browser
- use the package
- use the source
Cryptography is hard. Cryptography is important. Cryptography should be more accessible.
This library aims to tackle the last of the above sencences - it provides coherent API to use in browser as well as in server environment.
All the "heavy lifting" was done by the authors of the following, magnificent projects:
cryptops just wraps and combines some of their parts without adding anything that might lessen the security level.
Go ahead, inspect the source and see for yourself.
play in your browser
encrypting text using a passphrase:
decrypting text using a passphrase:
use the package
$ mkdir playground$ cd playground/$ npm init...$ npm i @stellar-fox/cryptops...
Three builds are provided:
play in node.js
example use in your code
encoding and decoding @xcmats/js-toolbox can
letmyPassphrase = "H0cus P0cus Open Sesam3 4brakadabra"myPreciousSecret = keypair
use the source
$ git clone firstname.lastname@example.org:stellar-fox/cryptops.gitCloning into 'cryptops'...$ cd cryptops$ npm i$ npm startCompiling
random: Functionsha256: Functionsalt32: Function: salt32genKey: Function: genKeysha512: Function hashLength: 64salt64: Function: salt64deriveKey: Function: deriveKeytimestamp: Function: timestampgenUUID: Function: genUUIDdecodeUUID: Function: decodeUUIDsalsaNonce: Function: salsaNoncesalsaEncrypt: Function: salsaEncryptsalsaDecrypt: Function: salsaDecryptaesNonce: Function: aesNonceaesEncrypt: Function: aesEncryptaesDecrypt: Function: aesDecryptencrypt: Function: encryptdecrypt: Function: decryptpassphraseEncrypt: Function: passphraseEncryptpassphraseDecrypt: Function: passphraseDecryptversion: '1.0.6'
$ npm run testuuid test✓ should generate uuid✓ should decode uuidpassphrase encrypt/decrypt test✓ should generate content✓ should encrypt✓ should have different ciphertexts✓ should decrypt✓ should match content✓ should not decrypt with a wrong passphrase8 passing
You can support this project via stellar network:
- Payment address: xcmats*keybase.io
- Stellar account ID:
cryptops are released under the Apache License, Version 2.0. See the LICENSE for more details.