mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 23:50:48 +02:00
- Added new routes and handlers for managing storage providers, including creation, editing, and deletion. - Introduced a new StorageProvider form component for user input. - Enhanced the database schema to support storage provider references in transfer configurations. - Implemented encryption for sensitive fields in storage provider data. - Added tests for storage provider API endpoints and integration with the database. - Updated frontend components to support storage provider selection and testing.
24 lines
717 B
Go
24 lines
717 B
Go
package encryption
|
|
|
|
// Key size constants
|
|
const (
|
|
// AES256KeySize is the key size in bytes for AES-256 encryption (32 bytes = 256 bits)
|
|
AES256KeySize = 32
|
|
|
|
// AESBlockSize is the block size for AES encryption
|
|
AESBlockSize = 16
|
|
|
|
// DefaultKeyEnvVar is the default environment variable name for the encryption key
|
|
DefaultKeyEnvVar = "GOMFT_ENCRYPTION_KEY"
|
|
|
|
// MinKeyLength is the minimum allowed length for encryption keys in bytes
|
|
MinKeyLength = AES256KeySize
|
|
)
|
|
|
|
// Error messages
|
|
const (
|
|
ErrKeyTooShort = "encryption key is too short, must be at least %d bytes"
|
|
ErrKeyNotProvided = "encryption key not provided in environment variable %s"
|
|
ErrInvalidKey = "provided encryption key is invalid: %s"
|
|
)
|