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

Max entry size #24

Open
didkivskyy opened this issue Apr 8, 2021 · 2 comments
Open

Max entry size #24

didkivskyy opened this issue Apr 8, 2021 · 2 comments

Comments

@didkivskyy
Copy link

What is the maximum size for a single key to be successfully stored?
I've been experimenting with longer strings (up to 1K characters) and was surprised that it stores the keys of such length without errors. But when getting back these keys strings come empty.
I realize this really depends on hardware limitations but I could not find any documented max size. Any info?

It would also be nice to have some kind of error/warning if the key is too large and is not going to be saved well.

Many thanks!

@fangornoftheforest
Copy link

Maximum key size for RSA is 256 bytes

@didkivskyy
Copy link
Author

Thanks for your answer.
This is interesting.
At least Android Keystore specification mentions different key sizes for different cryptosystems:

EC - 224, 256, 384, 521
RSA - 512, 768, 1024, 2048, 3072, 4096

Furthermore for more recent OS versions (Android 9 +) hardware security is supported with:

RSA 2048
AES 128 and 256
ECDSA P-256
HMAC-SHA256 (supports key sizes between 8 bytes and 64 bytes, inclusive)
Triple DES 168

This makes sense as since 2015 minimum recommended RSA and DSA key is 2048.

Maybe it is worth mentioning where this limitation comes from: the library inself or externally.

Thanks.

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

2 participants