0

Hi my case is i have to encrypt integer data(mob no) and Date (DOB) into database. i'm using hibernate for database connection. i don't want to convert my existing column datatype into varchar because it will impact my whole application. is this possible to encrypt data without changing datatype.

AmberKst
  • 21
  • 2

1 Answers1

1

Theoretically you could use an encryption algorithm which results in the same data type. For example, for integers this answer could be of help:

Simple integer encryption

Whether your should do this is a whole different question. It is trivially easy to decrypt the data for as for example a date of birth has a relatively fixed format and all output varieties are easily compiled into a dictionary.

Elias
  • 1,532
  • 8
  • 19