Rails encrypts database password in database.yml for SQL-Server

Our server department requires encryption of all passwords, including all Rails applications. Is there a way to encrypt a password in database.yml for MS SQL Server? And how can I do this in Rails?

+4
source share
1 answer

You can use crypto gem for this.

encrypted_password = Crypto.encrypt(password, 128_character_key, 128_character_iv)

To decrypt use

 password = Crypto.decrypt(encrypted_password,same_key,same_iv) 
0
source

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


All Articles