Skip to content
/ aes Public
forked from scloudrun/aes

aes encrypt and decrypt,cross language

Notifications You must be signed in to change notification settings

anley/aes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Aes encrypt and decrypt ,Cross language

Desc

support python,golang,php

Usage

usage go

func main() {
	key := "45f8c3dfbca782b4cd8a34f54f08c2bd"
	str := "aes_encrypt_decrypt_cross_language"
	enc, err := AesEncrypt([]byte(str), []byte(key))
	if err == nil {
		encodeString := base64.StdEncoding.EncodeToString(enc)
		fmt.Println("encrypt base64 string:",encodeString)
	} else {
		fmt.Println("err:", err)
	}
}

usage php

$key = "45f8c3dfbca782b4cd8a34f54f08c2bd";
$str = "aes_encrypt_decrypt_cross_language";
$encrypt = new AesCrypt();
$encrypt->setSecretKey($key);
$enc = $encrypt->encrypt($str);
echo $enc."\n\n";
$dec = $encrypt->decrypt("$enc");
echo $dec."\n\n";
?>

usage python

sk  = '45f8c3dfbca782b4cd8a34f54f08c2bd'
str = 'aes_encrypt_decrypt_cross_language'
res = getAesData(sk,str)
print 'encrypt base64 string:\t'+res

Contributing

Please feel free to submit issues, fork the repository and send pull requests!

About

aes encrypt and decrypt,cross language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 41.1%
  • Go 40.2%
  • Python 18.7%