0

Recently I was storing my field of database in base 64 encoded format. So that my plain text can not be stolen. But I have doubt that will base 64 decoding lead to duplication of data?

I have crores of rows in my 1 tb database. And I am scared if it makes some mistake, the whole database will be affected.

Please help. All that I want to know is

Does base 64 handles duplication or not?

EDIT :

I have a requirement in my project not to store a database field as plain text. So I am encoding it and decoding it when needed. Fetching data is rarely done. But data hiding is main thing.

prem30488
  • 2,828
  • 2
  • 25
  • 57
  • 3
    1. What is reduplication? 2. What do you mean "base64 encrypted"? I sure hope you mean you're not just converting it to base 64. – Putnam Jul 22 '20 at 07:18
  • I think the duplicate link answers your question. Worst case scenario, your table/colllection would bloat to about 4/3 of the original unencoded size. – Tim Biegeleisen Jul 22 '20 at 07:20
  • 2
    Can Base64 even be used for encrypting? I've thought it's only for encoding and doesn't make anything safer. – Amongalen Jul 22 '20 at 07:20
  • Base64 is at best only obfuscating the data, it can be easily converted back to another format, so no it is definetely not encryption – Lino Jul 22 '20 at 07:22
  • If you check the final bold sentence in the OP, this seems to be the primary question. Answer: yes, base 64 encoding can increase the space needed for input data (check the duplicate link). – Tim Biegeleisen Jul 22 '20 at 07:23
  • @TimBiegeleisen That's why we posted in the comments - cause it isn't an answer to the question itself but is kinda related, OPs approach might be wrong, if he actually wants to encrypt the data, base64 won't be any good no matter the reduplication. – Amongalen Jul 22 '20 at 07:26
  • Thanks guys. I only want to know that will base 64 provide encoded text which is same for some other text? – prem30488 Jul 22 '20 at 07:34
  • 1
    Base64 is just a way of representing data. It's not encryption and doesn't have anything to do with it. Storing data into a database in base64 doesn't make sense, because you're just wasting 25% of the space. You should rather explain what you actually need to do, instead of picking a solution and asking if it causes thing X to happen. – James Z Jul 22 '20 at 09:17

0 Answers0