Skip to content

Commit

Permalink
docs: crypto/aesutil/aesecb: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Jan 12, 2025
1 parent 8b4825f commit 8940395
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/aesutil/aesecb/aesecb.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// aesecb provides ECB (Electronic Codebook) mode for AES. Do not use this approach
// for new implementations due to weak security. This is provided for compatibility
// with previous implementations only.
package aesecb

import (
Expand Down Expand Up @@ -58,6 +61,9 @@ func removePKCS7Padding(data []byte, blockSize int) ([]byte, error) {
return data[:len(data)-paddingLen], nil
}

// EncryptBase64 provides ECB (Electronic Codebook) mode for AES. Do not use this approach
// for new implementations due to weak security. This is provided for compatibility
// with previous implementations only.
func EncryptBase64(v, key string) (string, error) {
paddedInput := addPKCS5Padding([]byte(v), aes.BlockSize)

Expand Down

0 comments on commit 8940395

Please sign in to comment.