Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rosbit/go-aes
encrypt/decrypt message with AES
https://github.com/rosbit/go-aes
Last synced: about 6 hours ago
JSON representation
encrypt/decrypt message with AES
- Host: GitHub
- URL: https://github.com/rosbit/go-aes
- Owner: rosbit
- License: mit
- Created: 2019-04-30T08:37:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T01:53:27.000Z (over 1 year ago)
- Last Synced: 2023-07-27T22:35:28.867Z (over 1 year ago)
- Language: Go
- Size: 7.81 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-aes
encrypt/decrypt message with AES## Usage
```go
package mainimport (
"github.com/rosbit/go-aes"
"fmt"
)func main() {
key := []byte("you key at least 16 bytes")
oriText := "message to be encrypted"// encrypt
crypted, err := goaes.AesEncrypt([]byte(oriText), key)
if err != nil {
fmt.Printf("failed to crypt: %v\n", err)
return
}// decrypt
decrypted, err := goaes.AesDecrypt(crypted, key)
if err != nil {
fmt.Printf("failed to decrypt: %v\n", err)
return
}if oriText != string(decrypted) {
fmt.Printf("decrypted string is not same as oriText")
return
}
fmt.Printf("test aes ok\n")
}
```## Status
The package is fully tested.## Contribution
Pull requests are welcome! Also, if you want to discuss something send a pull request with proposal and changes.