# #120 Active Record Encryption usage and troubleshooting

- URL: https://superails.com/posts/rails-7-120-active-record-encryption-usage-and-troubleshooting
- Published: 2023-03-23
- Duration: 13:34
- Access: free
- Topics: security, ruby on rails encrypted credentials, encryption, rails encryption

Active Record Encryption let's you encrypt data that is stored in the database (it's a very useful layer of security in case your database gets exposed).

In this episode we will add encryption to a few PII and PHI fields. We will encrypt data that is already present in the database, and ensure all new data is safely encrypted.

Episode source code: https://github.com/corsego/120-active-record-encryption/commit/75ece9c396baee3983358cee68733e3b26420d94
Based on this blogpost: https://blog.corsego.com/encrypted-credentials

0:00 ChatGPT is confidently wrong
1:12 What is Active Record Encryption
2:10 Add encryption to a Rails app
5:10 Non-deterministic encryption
5:56 Deterministic encrypyion can be queried
7:55 Encrypt all existing records
8:56 Encrypt an integer?
12:03 Display encrypted values

## Chapters

- 0:00 ChatGPT is confidently wrong
- 1:12 What is Active Record Encryption
- 2:10 Add encryption to a Rails app
- 5:10 Non-deterministic encryption
- 5:56 Deterministic encrypyion can be queried
- 7:55 Encrypt all existing records
- 8:56 Encrypt an integer?
- 12:03 Display encrypted values
