Skip to content

dhcgn/crypto

Repository files navigation

simple go crypto framework

Go Security Rating Technical Debt Vulnerabilities Bugs Code Smells Coverage Lines of Code

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.

cipherstring, err := simple.Encrypt("my secret password", []byte("my-secret-data"))

encrypted, err := simple.Decrypt("my secret password", "CSv1.443MMQSEWDPHEYKVS42FWJN633PS4EQIOFXDGMJOM2ON4ACJ.CIG44UL5BXWJU6JSW2BQ.KIORDLXAIJAT7NCTJHWYCE273Q")