https://github.com/dhcgn/crypto
Wrapper of secure encryption implementation to simplify the usage.
https://github.com/dhcgn/crypto
cryptography encryption go golang
Last synced: over 1 year ago
JSON representation
Wrapper of secure encryption implementation to simplify the usage.
- Host: GitHub
- URL: https://github.com/dhcgn/crypto
- Owner: dhcgn
- License: mit
- Created: 2021-07-29T17:17:59.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-06T23:25:07.000Z (over 3 years ago)
- Last Synced: 2025-01-23T13:08:21.530Z (over 1 year ago)
- Topics: cryptography, encryption, go, golang
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple go crypto framework
[](https://github.com/dhcgn/crypto/actions/workflows/go.yml)
[](https://sonarcloud.io/dashboard?id=dhcgn_crypto)
[](https://sonarcloud.io/dashboard?id=dhcgn_crypto)
[](https://sonarcloud.io/dashboard?id=dhcgn_crypto)
[](https://sonarcloud.io/dashboard?id=dhcgn_crypto)
[](https://sonarcloud.io/dashboard?id=dhcgn_crypto)
[](https://sonarcloud.io/dashboard?id=dhcgn_crypto)
[](https://sonarcloud.io/dashboard?id=dhcgn_crypto)
## Samples
### Simple Encryption
Uses AES-256-GCM (an authenticated encryption mode) to encrypt and decrypt data, password will be derived with PBKDF2 and 100.000 iterations. Because of this high iteration count the encryption and decryption process takes a minimum of around 200ms.
```go
cipherstring, err := simple.Encrypt("my secret password", []byte("my-secret-data"))
encrypted, err := simple.Decrypt("my secret password", "CSv1.443MMQSEWDPHEYKVS42FWJN633PS4EQIOFXDGMJOM2ON4ACJ.CIG44UL5BXWJU6JSW2BQ.KIORDLXAIJAT7NCTJHWYCE273Q")
```