Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto, only KeySize 32 is supported #241

Closed
epcim opened this issue Apr 16, 2021 · 1 comment
Closed

crypto, only KeySize 32 is supported #241

epcim opened this issue Apr 16, 2021 · 1 comment

Comments

@epcim
Copy link

epcim commented Apr 16, 2021

What happened:

Can you explain why only key size = 32B is supported?
One would expect it will be at-least variable, thus can be override.

https://github.com/blend/go-sdk/blob/master/crypto/local_transit.go#L21

  • the validation if len(decoded) != DefaultKeySize
// ParseKey parses a key from a string.
func ParseKey(key string) ([]byte, error) {
	decoded, err := hex.DecodeString(key)
	if err != nil {
		return nil, ex.New(err)
	}
	if len(decoded) != DefaultKeySize {
		return nil, ex.New("parse key; invalid key length")
	}
	return decoded, nil
}
@epcim
Copy link
Author

epcim commented May 5, 2021

// The key should be 16 bytes (AES-128), 24 bytes (AES-192) or 32 bytes (AES-256)

@epcim epcim closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant