https://github.com/andy-goryachev/memsafecrypto
A subset of BouncyCastle crypto primitives, refactored to use DirectByteBuffer.
https://github.com/andy-goryachev/memsafecrypto
argon2 blake2b bouncycastle poly1305 salsa20 salsa20engine sha256 xsalsa20 xsalsa20poly1305
Last synced: about 1 year ago
JSON representation
A subset of BouncyCastle crypto primitives, refactored to use DirectByteBuffer.
- Host: GitHub
- URL: https://github.com/andy-goryachev/memsafecrypto
- Owner: andy-goryachev
- License: apache-2.0
- Created: 2021-11-14T18:01:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-31T05:44:02.000Z (about 2 years ago)
- Last Synced: 2024-04-01T02:24:44.355Z (about 2 years ago)
- Topics: argon2, blake2b, bouncycastle, poly1305, salsa20, salsa20engine, sha256, xsalsa20, xsalsa20poly1305
- Language: Java
- Homepage:
- Size: 34.2 MB
- Stars: 30
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MemSafeCrypto
A subset of BouncyCastle crypto primitives, refactored to use DirectByteBuffer
instead of primitive arrays, to avoid leaving sensitive data in memory due to internal
copying and garbage compactification done by the JVM.
## Summary of Changes
- introducted [ICryptoZeroable](src/goryachev/memsafecrypto/ICryptoZeroable.java) interface
- created CByteArray, CIntArray, and CLongArray classes based on DirectByteBuffer
- modified BouncyCastle classes to use new array types
## Supported Primitives
- Argon2
- Blake2b
- DigestRandomGenerator
- HKDFBytesGenerator
- Poly1305
- Salsa20Engine
- Scrypt
- SHA256Digest
- XSalsa20Engine
## Dependencies
None.
(Bouncycastle library is used for tests only).
## Original Code
This project is based on BouncyCastle release 1.69:
https://github.com/bcgit/bc-java
## Projects That Use MemSafeCrypto
[Access Panel](https://github.com/andy-goryachev/AccessPanelPublic)
[DirCrypt](https://github.com/andy-goryachev/DirCrypt)
[Passwørd Safe](https://github.com/andy-goryachev/PasswordSafe)
[SecDB](https://github.com/andy-goryachev/SecDB)
## License
The project is licensed under Apache 2.0 license, which I believe is compatible with the BouncyCastle license
[LICENSE.html](src/goryachev/memsafecrypto/bc/LICENSE.html).