Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mascrypt0/encryption-kit
https://github.com/mascrypt0/encryption-kit
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mascrypt0/encryption-kit
- Owner: mascrypt0
- Created: 2024-03-22T09:37:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-22T09:51:19.000Z (10 months ago)
- Last Synced: 2024-04-24T05:53:05.719Z (9 months ago)
- Size: 361 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# encrypt-kit Usage
## npm
npm install encryption-kit
### JsSm4Client Encryption and Decryption tool
> Encapsulates JsSm4,
Configuration parameter
key : secret key* Encryption method
* @param plaintext
* encryptData( plaintext:string): string* Decryption method
* @param ciphertext
* decryptData(ciphertext:string): string```javascript
// introductionimport {JsSm4Client} from 'encryption-kit'
let jsSm4Client = new JsSm4Client('youKey')
let a = "1232123"
console.log(jsSm4Client.decryptData(jsSm4Client.encryptData(a))); // 1232123
```
### 2 RsaClient rsa encryption, decryption
> Encapsulates RsaClient,
Configuration parameter
key : secret key* Encryption method
* @param plaintext
* encryptData( plaintext:string): string* Decryption method
* @param ciphertext
* decryptData(ciphertext:string): string```javascript
// Exampleimport {RsaClient} from 'encryption-kit'
const publickKey = 'youPublickKey'
const privateKey = 'youPrivateKey'let rsaClient = new RsaClient(key)
let a = "1232123"
console.log(rsaClient.decryptData(rsaClient.encryptData(a))); // 1232123
```