Envelop Encryption

To secure storing sensitive information, a common approach is to use envelope encryption: A master key (usually managed by a secure KMS) A row-level key (used to encrypt individual records) Each row of sensitive data (e.g., credit card information) is encrypted using a unique row key, the row key itself is encrypted using the master key and stored alongside the data in the database. This setup allows secure key rotation, better isolation, and compliance with security standards. ...

April 11, 2025 · 5 min · 966 words · Khanh Bui

Why would sometimes 0.1 + 0.2 equals to 0.3, but sometimes it’s not in Go

You may have heard about 0.1 + 0.2 != 0.3 already, it’s a common issue in most programming languages. The reason behind that is the floating point (IEEE 754) as the computer can’t represent exactly a decimal in binary. By utilizing the floating point, the computer can hold a very large decimal, but the trade-off is it now can only represent the approximate of the true value. However, in this post, I will not explain how floating point works but something else – constant. ...

September 10, 2023 · 5 min · 971 words · Khanh Bui

A Note About Rust Smart Pointer and Deref

this article assumes you have some basic knowledge about Rust smart pointers. the dereference (*) operator dereference operator * is used for getting the actual value from a reference: 1 2 3 let a: i32 = 5; let b: &i32 = &a; assert_eq!(*b, 5); in the above example, b is a reference to a, *b will return the value that b pointing to. the smart pointers Box<T> here is an example of how you can init and modify the value of a Box: ...

December 11, 2022 · 4 min · 823 words · Khanh Bui