Java encryption and decryption in my Spring boot application

I have a Sprint-Boot application that uses H2 (test) and Postgres (production). I have a need to keep client data safe. I also need to be able to search the database (using Spring -Data-JPA with Hibernate) and use this data, so it seems to me that I need some kind of encryption. I see that there are AttributeConverters, Jayst and Spring Security has a TextEncryptor interface, which seems to be suitable for encryption and decryption. I thought Spring could have this Data-JPA / Security built into its projects, but I haven't found it yet. I use BCryptPasswordEncoder for my password security.

However, I am not sure about a great way to encrypt / store / search / decrypt data using Java / Spring / Hibernate. My first thought is that if it is encrypted, you cannot search for it. I thought that maybe I need the database to handle encryption, but I read articles protecting it.

Can anyone suggest a very safe solution?

+4
source share

Source: https://habr.com/ru/post/1624381/


All Articles