# visualcrypto

> visual crypto

Latest version **1.0.4** (published 2021-06-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install visualcrypto
pnpm add visualcrypto
yarn add visualcrypto
bun add visualcrypto
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-06-01 |
| First published | 2021-05-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 96.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | minilong |
| Maintainers | minilong1 |

## Links

- npm: https://www.npmjs.com/package/visualcrypto
- npm.io page: https://npm.io/package/visualcrypto

## Dependencies (2)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0
- [@types/crypto-js](https://npm.io/package/@types/crypto-js.md) ^4.0.1

## Recent versions

- 1.0.4 (latest) — 2021-06-01
- 1.0.3 — 2021-05-24
- 1.0.2 — 2021-05-24
- 1.0.1 — 2021-05-24
- 1.0.0 — 2021-05-23

## README

# 简介
- 本库提供AES算法

# 使用
- 引入
```js
import AESVisual from 'visualcrypto';
```
- 加密
```js
const msg = '123';
const key = 
const msg = encrypt(msg, key)
```
# 内部实现流程
- 获取明文，秘钥，加密模式，填充模式，偏移向量
- 秘钥校验与填充，得到一个密码块(CipherBlock)
- 明文根据编码模式转换成16进制序列，分成N个块，最后一个块进行padding
- 获取块加密模式
- 秘钥编排
- Add Rounds keys
- SubByte
- ShiftRow
- MixColumn
- 最后一轮
- 输出最终加密结果
- 转为base64
- 每个阶段的state都保存在内存中
- 保存加密过程（短期保存/长期保存）短期保存在localstorage，长期保存在server

---
_Source: https://npm.io/package/visualcrypto · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
