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

Size limit on Android #1

Closed
NetPumi2 opened this issue Jun 13, 2017 · 5 comments
Closed

Size limit on Android #1

NetPumi2 opened this issue Jun 13, 2017 · 5 comments

Comments

@NetPumi2
Copy link

NetPumi2 commented Jun 13, 2017

Hi is there size limit for android? Because i want to send this string to storage but on the other side doesn't show anything.

...
const text = 'E0cSGRsAAB0YBgsEBwk/GgoVBQMNR0kXTQsJGgkBHCw3TlVKMhIBWDkuITkbLVEqCFpbJAJVGwYdClobB1E2IAo8UDJOQ0oXHAAKSl9RCAALERweTURHFgEOAQksGgoaDBUFCgxHSQoOBBYWQE0NCBIFA0pfUQ0LBQwdLA4MCBoCQQsKHk5DShUaDxsdFxZOVUoNBxgfG19cQxxGAgENGQkREh5BCwoeQw4eBAcNHUdTRwleCl0XX1sOUUFZC1lcFl0KDVcWDVhaVkUIXFhXS1McVVFLXEkaWAMLSQxYGxgbGBZWXy5NVzVJXS4GFwJBCRAHBF9GBhwBSlojEhoOHAQBH0paIxIIQRgLFE5DShAACR0hAVFWTQkQBwRfFFBKXQlYXBBaXgwHFw5ZWwcRVFhQBxcJWEpJUQ8dDQQHCQspEVFWTVpVQltCWFBeXVY8VEZWX11fR15BUFZENk1ERxoICgYRGhgGDRZRVjQTRwADDAEEH05VDgQfHwpERxADAQYAEBgGBwtRVk09FhYeAQkIFkE/CRYAGwAaAV4tGhwNFgIbAQYSGAYHC1FATRgXHBoGDAABTlVKBAYYB1hHX04aGwABJQtKX1FZVlkDQ1UMXlQXDgsKU0AODVBSSw4LDVJRETJERx0NAg1HSU4ODAgaAi8JAR4FAUYGHAFNREcdBQwDCxIBCkpfUQ0LBQwdTkNKAh8DDQkJLA8DAQAdGDABAVFWTTtdSwI7IjYqWQwqBixZFyEHG1QtGgQWKwMkUgFUWRkIUUBNHRYWHiINERIIDhwEUVYUSgAeDQYER0lODRIfCRYVSklRHgAEAFFWTQAKBQkLB0cOQE0JFQMhChwEFw0bCUdJF00aCh8JTVJHFwMMHAoBThJERwYcCwkRFggwCRFRVk1aVUJbQlhTXl1cPFREVlxaX0BfQVlWQDZNFUlRCRcYDAEJHEpfUV1WX1VeXF5FVEs4X19fRlpVXVRdXVpbP1FATRwcAwlNUkcRCQ4aAAFOQ0oXFgodDRYbOAADAB1OVUo9BhoeXy0XNjdQLQteGxI1H1s1LQNEVVoJCDQCKVwRP1sBRVA1NCwfNgMfVjtHX04GDDEcBwoGR0lOChEvQwk3KQw8BSUjM0I9BiQmOQQNLwYaIwYiLCYWJlkrGiZWRgAKJh8LVj4FIAEvHAgnOhIQFgAeKUEmXgsIHwQNBTMBDQZdCRc/WgABKz4AJSZGBg1aVQUlBh8MEF85ASwZAwYxPSVcDiwnSyI7Ax0pBi5dPAk1FzIiOQc2AjwJNQIhUT0WBwE/NDlcIQwEBTYwMxglBQcMJV4pHCtCKiM9CSVcPTw3KTYrPR8iNCpdATRZWw0xKVwNEjc1OCg+MD05KgEpMCYDDS0yBSACIEMjOwtVPjgqECsnIRwhCB8ECyssRSE7OVA9FiJbKycpXiVWQ0IJPyxCCys/DgojIy4TPwYeRRU4NSQwUSwaDCRcC1hdWAosNj0ZKx8LBlAWUUBNCQYQCRwbMRwHCgZHSU4XKyQZFgokLgsYFw43QRpCShg';

  RNSecureKeyStore.set(KEY_DATA, text).catch((errors) => {
    console.log("ERRROR: ", errors);
  });
...

And i didn't get any error ... can you help me? On ios its work fine...

@pradeep1991singh
Copy link
Owner

@NetPumi2
Yes, there is limit for android. As android lib module is using RSA with padding for encryption there is limit to the string which can be encrypted and limit is 245 byte.
And in your case you are passing 1543 byte data which is exceeding limit. Thats why its not working for you. Try to save key in chunks of 245 byte.

@NetPumi2
Copy link
Author

Is there some limit for IOS?

@pradeep1991singh
Copy link
Owner

In case of iOS there is no size limit for the values. It depends on the amount of memory you have available in device.

@Overtorment
Copy link

Are those numbers actual..? I tested on Android emulator yesterday, and my strings were definitely bigger than 245 bytes. They were actually quite big JSON stringified objects. All worked as expected.

@tombailey
Copy link
Contributor

@pradeep1991singh I think there used to be a limit for Android but there no longer is since we switched to AES to encrypt the plain text

pradeep1991singh pushed a commit that referenced this issue May 23, 2022
add mavenCentral as priority for repos than jcenter
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

4 participants