(data []byte, key []byte)
| 24 | } |
| 25 | |
| 26 | func encrypt(data []byte, key []byte) []byte { |
| 27 | block, _ := aes.NewCipher(key) |
| 28 | gcm, err := cipher.NewGCM(block) |
| 29 | if err != nil { |
| 30 | panic(err.Error()) |
| 31 | } |
| 32 | |
| 33 | nonce := UnixTimePrefixedRandomNonce(gcm.NonceSize()) |
| 34 | |
| 35 | cipherText := gcm.Seal(nonce, nonce, data, nil) |
| 36 | return cipherText |
| 37 | } |
| 38 | |
| 39 | func decrypt(data []byte, key []byte) []byte { |
| 40 | block, err := aes.NewCipher(key) |
nothing calls this directly
no test coverage detected