@@ -16,6 +16,7 @@ import (
1616)
1717
1818// AesEncrypt encrypts text and given key with AES.
19+ // It is only internally used at the moment to use "SECRET_KEY" for some database values.
1920func AesEncrypt (key , text []byte ) ([]byte , error ) {
2021 block , err := aes .NewCipher (key )
2122 if err != nil {
@@ -27,12 +28,13 @@ func AesEncrypt(key, text []byte) ([]byte, error) {
2728 if _ , err = io .ReadFull (rand .Reader , iv ); err != nil {
2829 return nil , fmt .Errorf ("AesEncrypt unable to read IV: %w" , err )
2930 }
30- cfb := cipher .NewCFBEncrypter (block , iv )
31+ cfb := cipher .NewCFBEncrypter (block , iv ) //nolint:staticcheck // need to migrate and refactor to a new approach
3132 cfb .XORKeyStream (ciphertext [aes .BlockSize :], []byte (b ))
3233 return ciphertext , nil
3334}
3435
3536// AesDecrypt decrypts text and given key with AES.
37+ // It is only internally used at the moment to use "SECRET_KEY" for some database values.
3638func AesDecrypt (key , text []byte ) ([]byte , error ) {
3739 block , err := aes .NewCipher (key )
3840 if err != nil {
@@ -43,7 +45,7 @@ func AesDecrypt(key, text []byte) ([]byte, error) {
4345 }
4446 iv := text [:aes .BlockSize ]
4547 text = text [aes .BlockSize :]
46- cfb := cipher .NewCFBDecrypter (block , iv )
48+ cfb := cipher .NewCFBDecrypter (block , iv ) //nolint:staticcheck // need to migrate and refactor to a new approach
4749 cfb .XORKeyStream (text , text )
4850 data , err := base64 .StdEncoding .DecodeString (string (text ))
4951 if err != nil {
0 commit comments