2

Yo,

I was just wondering if/what the limitations are on input string lengths, when it comes to encrypting strings. (via AES &/or Base64)

Essentially I have a big, giant string, and before storing it in the database, I would like to encrypt it.

Is there a set length? (e.g. like a max of 10,000 characters, etc.?)

Thanks in advance & happy coding! :-)

iBenji

2
  • Well, a hard limit on string length (due to CLR) seems to be 1,073,741,823 characters (see: stackoverflow.com/a/140749/1336590). Other than that, there shouldn't be inherit restictions due to the algorithms themself (citation needed). If at all, then due to memory or implementation specific. -- Btw. Base64 is more of an encoding and not so much of an encryption. Commented Jan 19, 2017 at 10:59
  • Thank you! Over a billion characters, wow! I guess my string was smaller than I thought. Kind of reminds me of this: youtube.com/watch?v=GoW8Tf7hTGA Thanks again! Commented Jan 19, 2017 at 11:11

1 Answer 1

5
  1. Base64 is an encoding, not encryption, it is limited String size limits.

  2. AES is encryption and data based not String based and has no limitations other than source, destination and OS limitations.

  3. Some AES security concerns begin to appear when the amount of data encrypted with a single key approaches 250 exabytes, See SO answer by Thomas Pornin.

Sign up to request clarification or add additional context in comments.

1 Comment

I always get concerned when I encrypt over 250 exabytes. Scary stuff. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.