This website uses cookies to ensure you get the best experience. Learn More.
One more news and reason to use Objects :)
From Liferay 7.4 U80 it was implemented the option for encryption on the Object field.
A functionality to be able to encrypt specific object fields, it will prevent someone with the direct access to the database from viewing the sensitive information.
To be able to use the Object’s Encrypted field, firstly you'll need to add the encryption key in portal-ext.properties or as a Environment Variable (please see the important properties highlighted below with the example values):
## ## Object ## # # Env: LIFERAY_OBJECT_PERIOD_ENCRYPTION_PERIOD_ALGORITHM # object.encryption.algorithm=AES # # Env: LIFERAY_OBJECT_PERIOD_ENCRYPTION_PERIOD_ENABLED # object.encryption.enabled=true # # Env: LIFERAY_OBJECT_PERIOD_ENCRYPTION_PERIOD_KEY # generated key as bytes -> enconded as base64 # object.encryption.key=Um9zZWxhaW5lTWFycXVlcw==
## ## Object ## # # Env: LIFERAY_OBJECT_PERIOD_ENCRYPTION_PERIOD_ALGORITHM # object.encryption.algorithm=AES # # Env: LIFERAY_OBJECT_PERIOD_ENCRYPTION_PERIOD_ENABLED # object.encryption.enabled=true # # Env: LIFERAY_OBJECT_PERIOD_ENCRYPTION_PERIOD_KEY # generated key as bytes -> enconded as base64 # object.encryption.key=
$ echo -n 'RoselaineMarques' | base64
After applied the configuration above, just restart your portal and you will be able to create a encrypted field in your Object:
Creating a new record entry you can see the field encrypted in the Database:
In the Headless API or UI the data is decrypted as you can see below:
.... And that's it! Hope this new feature helps you to store your sensitive data \o/ .....