Skip to content
Agang edited this page Jul 22, 2016 · 2 revisions

简介

这个包封装了一些我们实践项目中最长用到的加密方法,使用起来更加方便。

用法

import

import (
    "andals/gobox/crypto"
)

Md5

func Md5(data []byte) []byte

输出md5字符串值

AES对称加解密(CBC模式)

func AesCBCEncrypt(key, data []byte) []byte
func AesCBCDecrypt(key, crypted []byte) []byte

这两个方法主要让使用者无须再关注加解密的一些细节,golang原生包的使用是需要对这些细节有一定理解才能用好。

Clone this wiki locally