0.4.5 • Published 3 years ago

@pf222jd/pntscrypt v0.4.5

Weekly downloads
-
License
AGPL-3.0-only
Repository
github
Last release
3 years ago

Pntscrypt

node.js module for encryption, decryption and hashing of strings.

Usage

import { Pntscrypt } from "Pntscrypt.js";

const SECRET_STRING = "mysecret1337"

const encryption = new Pntscrypt(SECRET_STRING)
const encryptedString = encryption.encryptUsingSubstitution()
console.log(encryptedString);
> 2d8tr7t9giim

const decryption = new Pntscrypt(encryptedString)
const decryptedString = decryption.decryptUsingSubstitution()
console.log(decryptedString)
import pntscrypt from 'pntscrypt'
> mysecret1337

const hash = new Pntscrypt(SECRET_STRING);
const hashedString = hash.encryptUsingHash();
console.log(hashedString);
> 788979711985162

Limitations

Can only encrypt and decrypt lowercase a-z and 0-9.

Versions

VersionChanges
0.4.5Add validation to Hash constructor
0.4.4Add validation to Substitution constructor
0.4.3Make char type work in validation
0.4.2Add validation to CharacterMapping constructor
0.4.1Fix error in hashing function
0.4.0Add hash support
0.3.0Add rounds support to encryption using substitution
0.2.0Add decryption support using substitution
0.1.0Add encryption support using substitution