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

Penjimon
  • 469
  • 4
  • 20
  • Well, a hard limit on string length (due to CLR) seems to be 1,073,741,823 characters (see: http://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. – Corak Jan 19 '17 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: https://www.youtube.com/watch?v=GoW8Tf7hTGA Thanks again! – Penjimon Jan 19 '17 at 11:11

1 Answers1

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.

Community
  • 1
  • 1
zaph
  • 111,848
  • 21
  • 189
  • 228