fix: url safe encryption with no padding
This commit is contained in:
parent
84e5159508
commit
68caf35e58
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ func EncryptAES(data string, key string) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
|
||||
return base64.URLEncoding.EncodeToString(encrypted), nil
|
||||
return base64.RawURLEncoding.EncodeToString(encrypted), nil
|
||||
}
|
||||
|
||||
func EncryptBytesAES(plainText []byte, key string) ([]byte, error) {
|
||||
|
@ -37,7 +37,7 @@ func EncryptBytesAES(plainText []byte, key string) ([]byte, error) {
|
|||
}
|
||||
|
||||
func DecryptAES(data string, key string) (string, error) {
|
||||
text, err := base64.URLEncoding.DecodeString(data)
|
||||
text, err := base64.RawURLEncoding.DecodeString(data)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue