Skip to content

Instantly share code, notes, and snippets.

@litvil
Created February 16, 2017 18:01
Show Gist options
  • Select an option

  • Save litvil/47e2bfdb3181332383b9260efa17f4be to your computer and use it in GitHub Desktop.

Select an option

Save litvil/47e2bfdb3181332383b9260efa17f4be to your computer and use it in GitHub Desktop.
AES encryption
AES is a block-level algorithm. So when data encrypted it is padded. So you can calculate the length of the result string using this formula:
1
16 × (trunc(string_length / 16) + 1)
So if your address field structure is = VARCHAR(100) ; //100 length of varchar
Then before your encryption it should be converted
= 16 * (trunc(100/ 16) + 1)
= 16 * (6.25 + 1)
= 16 * 7.25
= 116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment