در پست قبلی گفتیم چرا باید اطلاعات حساس افراد مثل کد ملی و موبایل را رمز کرد.
برای اینکه در Spring boot خیلی تمیز این کارو انجام بدید توی Entity با انوتیشن convert@ مقادیر رو موقع نوشتن encrypt و موقع خوندن decrypt میکنید. اتوماتیک!
کلاس Encryptor پیاده سازی دو متد convertToDatabaseColumn convertToEntityAttribute
رو داره که موقع نوشتن و خواندن استفاده میشه.
ترجمه:
Security of web applications 4
In the previous post, we said why it is necessary to encrypt people’s sensitive information such as national code and mobile phone.
In order to do this very cleanly in Spring boot, in Entity, you encrypt the values when writing and decrypt when reading them with @ convert annotation. Automatic!
The Encryptor class implements two convertToDatabaseColumn convertToEntityAttribute methods
It is used when writing and reading.
In the previous post, we said why it is necessary to encrypt people’s sensitive information such as national code and mobile phone.
In order to do this very cleanly in Spring boot, in Entity, you encrypt the values when writing and decrypt when reading them with @ convert annotation. Automatic!
The Encryptor class implements two convertToDatabaseColumn convertToEntityAttribute methods
It is used when writing and reading.