https://github.com/mpaland/mipher
Mobile Cipher library written in clean TypeScript
https://github.com/mpaland/mipher
aes chacha20 crypto-library curve25519 ed25519 fortuna-prng hmac keccak pbkdf2 serpent sha-1 sha-256 sha-3 sha-512 shake typescript uuid
Last synced: 3 months ago
JSON representation
Mobile Cipher library written in clean TypeScript
- Host: GitHub
- URL: https://github.com/mpaland/mipher
- Owner: mpaland
- License: mit
- Created: 2017-09-04T16:33:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-14T20:18:35.000Z (over 7 years ago)
- Last Synced: 2025-06-14T21:45:39.383Z (4 months ago)
- Topics: aes, chacha20, crypto-library, curve25519, ed25519, fortuna-prng, hmac, keccak, pbkdf2, serpent, sha-1, sha-256, sha-3, sha-512, shake, typescript, uuid
- Language: TypeScript
- Size: 1.74 MB
- Stars: 21
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mipher
[](https://www.npmjs.com/package/mipher)
[](https://www.npmjs.com/package/mipher)
[](https://www.versioneye.com/user/projects/5af9edc10fb24f0e57e3d95d)
[](http://github.com/mpaland/mipher/issues)
[](https://github.com/mpaland/mipher/releases)
[](https://raw.githubusercontent.com/mpaland/mipher/master/LICENSE)**M**obile C**ipher** crypto library written in clean TypeScript
## Highligths and design goals
There are a lot of crypto libs in JS around, but I needed a clean, lightweight, reliable, fast and simple lib for mobile devices in TypeScript. That's **mipher**.
A collection of common crypto algorithms, optimized for speed, security and size.- Only usage of modern typed arrays like `Uint8Array` and `Uint32Array` as message/data types
- Fast and simple, no dependencies
- Own crypto random generator (using a FORTUNA implementation)
- Extensive passing test suite
- MIT license## Supported algorithms
- AES
- Serpent
- Chacha20
- Curve25519, Ed25519
- HMAC
- PBKDF2
- SHA-1, SHA-256, SHA-512, SHA-3, Keccak, SHAKE
- UUID
- Random generator
- Blockmodes (ECB, CBC, CTR)
- Padding (PKCS5, PKCS7, zero padding)
- Format converter (bin, number, hex, base64, string)
- Utils (xor, cryptocompare etc.)## Usage
Import the mipher module as `mipher` and create your according crypto object:
```typescript
import * as mipher from 'mipher';let aes = new mipher.AES();
let ct = aes.encrypt(key, pt);
```## Test suite
mipher is using the mocha test suite for testing.
To do all tests just run `npm run test`.## Contributing
If you find any bugs, have any comments, improvements or suggestions:1. Create an issue and describe your idea
2. [Fork it](https://github.com/mpaland/mipher/fork)
3. Create your feature branch (`git checkout -b my-new-feature`)
4. Commit your changes (`git commit -am 'Add some feature'`)
5. Publish the branch (`git push origin my-new-feature`)
6. Create a new pull request
7. Profit! :white_check_mark:## License
mipher is written under the [MIT license](http://www.opensource.org/licenses/MIT).