Gathering detailed insights and metrics for @element-ts/krypton
Gathering detailed insights and metrics for @element-ts/krypton
Gathering detailed insights and metrics for @element-ts/krypton
Gathering detailed insights and metrics for @element-ts/krypton
A very light weight package written in Typescript combining node/crypto and bcrypt for some helpful methods.
npm install @element-ts/krypton
Typescript
Module System
Node Version
NPM Version
68.7
Supply Chain
89.2
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (98.9%)
JavaScript (1.1%)
Total Downloads
2,923
Last Day
1
Last Week
6
Last Month
17
Last Year
405
MIT License
10 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Nov 23, 2024
Minified
Minified + Gzipped
Latest Version
0.3.3
Package Id
@element-ts/krypton@0.3.3
Unpacked Size
33.69 kB
Size
7.32 kB
File Count
21
NPM Version
6.13.7
Node Version
13.7.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-14.3%
6
Compared to previous week
Last Month
-78.8%
17
Compared to previous month
Last Year
9.8%
405
Compared to previous year
2
5
A very light weight package written in Typescript combining node/crypto
and bcrypt
for some helpful methods.
NOTE, I am not using my own crypto with this project, it is using recommend crypto from node and bcrypt.
Import what you need. You will most likely not need to import all of these.
1import { 2 KrBcrypt, 3 KrHash, 4 KrHashAlgorithm, 5 KrRSA, 6 KrRSAKeyPair 7} from "element-ts/krypton";
KrBcrypt
1const password: string = "1234"; 2const createdPassword: Buffer = await KrBcrypt.createPassword(password); 3const checkPassword: boolean = await KrBcrypt.verifyPassword(password, createdPassword);
KrHash
1const hashedData: Buffer = KrHash.hash(Buffer.from("Hello, world!"); 2const hashedData: Buffer = KrHash.hash(Buffer.from("Hello, world!", KrHashAlgorithm.sha512)); 3 4const hasher: KrHash = new KrHash() 5hasher.append(Buffer.from("Hello")); 6hasher.append(Buffer.from("World")); 7const hashedData: Buffer = hasher.hash();
KrCipher
1// instance 2const cipher: KrCipher = new KrCipher(Buffer.from("password")); 3const msg: Buffer = Buffer.from("Hello, world!"); 4const encryptedData: Buffer = cipher.encrypt(msg); 5const decryptedData: Buffer = cipher.decrypt(encryptedData); 6console.log(msg === decryptedData); 7 8// static 9const encryptedData: Buffer = KrCipher.encrypt(Buffer.from("Hello, world!"), Buffer.from("password"), Buffer.from("the-salt")); 10const decryptedData: Buffer = KrCipher.decrypt(encryptedData, Buffer.from("password"), Buffer.from("the-salt")); 11
KrRSA
1 2const keys: KrRSAKeyPair = KrRSA.generateKeys(); 3 4const message: string = "Hello, world!"; 5const dataUnEncrypted: Buffer = Buffer.from(message); 6const dataEncrypted: Buffer = KrRSA.encrypt(dataUnEncrypted, keys.publicKey); 7const dataDecrypted: Buffer = KrRSA.decrypt(dataEncrypted, keys.privateKey); 8 9const messageDecrypted: string = dataDecrypted.toString("utf8");
You can view the declaration files or even the source code on GitHub.
If you find any bugs please create an issue on GitHub or if you are old fashioned email me at elijah@elijahcobb.com.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More