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
npm install @element-ts/krypton
Typescript
Module System
Node Version
NPM Version
47.6
Supply Chain
87.6
Quality
72.2
Maintenance
100
Vulnerability
98.2
License
TypeScript (98.9%)
JavaScript (1.1%)
Total Downloads
2,749
Last Day
8
Last Week
16
Last Month
19
Last Year
278
10 Commits
2 Watching
1 Branches
1 Contributors
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%
8
Compared to previous day
Last week
700%
16
Compared to previous week
Last month
0%
19
Compared to previous month
Last year
-40.2%
278
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
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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 2024-12-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