https://github.com/samchon/aes-pkcs
AES PKCS 5 encryptor & decryptor
https://github.com/samchon/aes-pkcs
Last synced: about 16 hours ago
JSON representation
AES PKCS 5 encryptor & decryptor
- Host: GitHub
- URL: https://github.com/samchon/aes-pkcs
- Owner: samchon
- License: mit
- Created: 2020-08-26T05:59:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-15T05:40:23.000Z (about 5 years ago)
- Last Synced: 2026-01-19T10:53:42.383Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AES-PKCS
## Outline
The npm module `aes-pkcs` provides an utility class `AesPkcs5` using below options:
- AES-128/256
- CBC mode
- PKCS#5 Padding
- Base64 Encoding
## Installation
```bash
npm install --save aes-pkcs
```
## Usage
### Example Code
```typescript
import { AesPkcs5 } from "aes-pkcs";
const content: string = "Hello world! This is an example content for the AesPkcs.encode() and decode() functions.";
const key: string = "p69nfZ7H2kSaA2vO";
const iv: string = "f8U1pc8jo7fvNAUV";
const encoded: string = AesPkcs5.encode(content, key, iv);
const decoded: string = AesPkcs5.decode(content, key, iv);
console.log(encoded);
console.log(decoded);
```
### Console Output
```bash
B/ZQ1VHSGBpo2KwDiiLZCKO/
Hello world! This is an example content for the AesPkcs.encode() and decode() functions.
```