Are they encrypted in disk? How? Are they safe, for example, in the event of someone booting from a Live CD and mounting the hard disk?
How is the encryption key generated? Is it different in Windows and Linux?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityAre they encrypted in disk? How? Are they safe, for example, in the event of someone booting from a Live CD and mounting the hard disk?
How is the encryption key generated? Is it different in Windows and Linux?
You seem to be curious specifically about the key used to encrypt the passwords in Chrome.
The answer is:
Every password is encrypted with a different random key.
And then the encrypted password is stored in the SQLite database file:
%LocalAppData%\Google\Chrome\User Data\Default\Login Data
You can use something like SQLite Database Browser or SQLite Maestro to view it. Here's a snippet from my Login Data
file:
origin_url username_value password_value
======================================== ============== ========================
http://thepiratebay.org/register [email protected] 01000000D08C9DDF0115D1118C7A00C04FC297EB01000000BB0E1F4548ADC84A82EC0873552BCB460000000002000000000003660000C0000000100000006811169334524F33D880DE0C842B9BBB0000000004800000A00000001000000043C8E23979F5CC5499D73610B969A92A08000000EE07953DEC9F7CA01400000098B5F0F01E35B0DC6BBAFC53A9B1254AC999F4FA
You'll notice the password is an encrypted blob of data. The approximate algorithm to encrypt a new password is:
And Chrome saves that blob to its SQLite database.
But to answer your question: Where does the encryption key come from?
Each password is encrypted with a different randomly generated key
Of course i left out the technical details. Chrome does not encrypt your passwords itself. Chrome does not have a master key used to encrypt anything. Chrome does not do the encryption. Windows does.
There is a Windows function, CryptProtectData
, which is used to encrypt any arbitrary data you like. The details of calling it is less important. But if i invent a pseudo-language that somewhat can be decipherable as any programming languge, Chrome calls:
CryptProtectData(
{ cbData: 28, pbData: "correct battery horse staple" },
"The password for superuser.com and all the glee therein",
null, //optional entropy
null, //reserved
null, //prompt options
0, //flags
{ cbData: pbData: }); //where the encrypted data will go
So the password:
correct battery horse staple
01000000D08C9DDF0115D1118C7A00C04FC297EB01000000BB0E1F4548ADC84A82EC0873552BCB460000000002000000000003660000C0000000100000006811169334524F33D880DE0C842B9BBB0000000004800000A00000001000000043C8E23979F5CC5499D73610B969A92A08000000EE07953DEC9F7CA01400000098B5F0F01E35B0DC6BBAFC53A9B1254AC999F4FA
You'll notice that i never needed to supply a password. That is because Windows takes care of all of that. In the end:
So the only way for someone to know your password is if they know your password.
Note: It goes without saying, but I'll say it anyway: this only applies to Chrome running on Windows.
%LocalAppData%\Google\Chrome\User Data\Default\Login Data
Oct 21, 2015 at 14:01
The passwords are encrypted and stored in a SQLite database:
The important piece here is
CryptProtectData
, which is a Windows API function for encrypting data. Data encrypted with this function is pretty solid. It can only be decrypted on the same machine and by the same user that encrypted it in the first place.
CryptProtectData
uses your Windows credentials (not the password, but some other data) as the key. AFAIK, it's the same function used to protect your certificates, network credentials and all that stuff.
May 29, 2010 at 19:23
Encryptor::EncryptString
does not do anything. There seems to be code for using GNOME Keyring and KDE Wallet.
May 29, 2010 at 19:38
They are "encrypted" but it's a reversable encryption. Chrome has to send the raw password to the site it was stored for, so if Chrome can decrypt and use it, so can other people. Storing passwords is never 100% safe.
CryptProtectData
is a Windows API, Windows actually does all the encryption and retrieval, the encryption key is dependent on your user account and system.
Google Chrome encrypts passwords and stores them in SQLite DB but they could be easily viewed with the special password recovery applications such as ChromePass (http://www.nirsoft.net/utils/chromepass.html) or SecurePassword Kit (http://www.getsecurepassword.com/)
On the Mac, the equivalent to the CryptProtectData function in Windows is to access the password for "Chrome Safe Storage" in OS X's Keychain.