Skip to content

FLAGLORD/goaes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goaes

an implementation of AES algorithm using golang.

In my implementation, padding uses the PKCS#7, and mode of operation uses the CBC. You can replace these with yours.

中文用户可以在我的博客中了解实现思路。

Usage

If you don't have a aes key, you can create one as follows:

// create a 256-bit key
key, _ := NewAesKey(AES256) 
// you can also create 128-bit, 192-bit
...

Encrypt:

plainText := "hello, world"
cipherText, err := Encrypt(key, []byte(plainText))

Decrypt:

plainText, err := Decrypt(key, cipherText)

You can also copy code in aes.go to your file as it will not import new dependency.

Reference

What is block cipher

About

an implementation of AES algorithm using golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages