3,780 reputation
1420
bio website
location
age
visits member for 2 years, 4 months
seen yesterday

Jul
24
comment Store private key on server, then use k1 to log in, k2 to verify HMAC and k3 to decrypt private key
If you don't know whether your intended recipient uses PGP, then you can't use PGP. In order to encrypt the message properly, you have to know (and trust to be correct) the recipient's public key. The message is encrypted symmetrically with a random key, then that key is encrypted asymmetrically with the recipient's public key, and then the entire thing is digitally signed with your private key. The recipient can then verify you sent it by checking the signature with your public key, and is the only one that can decrypt the message key using their private key.
Jul
24
comment Is it acceptable to generate salts with a hash of the username?
Yes. Each new hash should have a new salt, otherwise by cracking one hash and saving all previous attempts, you now have a rainbow table to start with for all future password changes by that user.
Jul
24
comment Store private key on server, then use k1 to log in, k2 to verify HMAC and k3 to decrypt private key
This is why PGP implementations typically stand alone; if you could trust your e-mail server to secure your messages properly, you wouldn't need PGP. Giving your PGP private key to the e-mail server for safe-keeping, even encrypted, takes the responsibility out of your hands.
Jul
24
comment Store private key on server, then use k1 to log in, k2 to verify HMAC and k3 to decrypt private key
Well, the server could still hash k1 again and store that, meaning that an attacker could obtain a list of usernames and k1 hashes and still wouldn't have what they needed to obtain the rest of the data via the service endpoint. If you can't trust the server, you lose; if the server's owner goes over to the dark side then social engineering is trivial, because the guy calling you really is the person who should be resolving any user login issues.
Jul
24
answered Store private key on server, then use k1 to log in, k2 to verify HMAC and k3 to decrypt private key
Jul
16
comment How to protect against “padding oracle attacks.”
Oracles get their name from exactly what I describe. I tailored the cryptographic definition towards a malicious attack, but white hats and other good guys can use oracles just as effectively for benevolent purposes, including the intended purpose for a particular security scheme.
Jul
16
comment How to protect against “padding oracle attacks.”
Well, oracles don't just give pass/fail results. The "random oracle" is another useful conceptual oracle, which takes in messages and produces random numbers that are always the same for a given message but never the same for any two different messages. This is the conceptual idea that we simulate with hash functions. We don't know how it's done (in fact we cannot achieve such behavior computationally) and don't need to know; all we have to know is how to use it.
Jul
16
revised Can unencrypted keys & logins be kept out of program memory?
added 843 characters in body
Jul
16
answered How to protect against “padding oracle attacks.”
Jul
11
revised How to secure database table of users for an application?
added 1 characters in body
Jul
11
comment Encrypted files storage. How to simplify the password management scheme?
Just don't get caught up in the new sweetness and use sCrypt for sCrypt's sake. Lots of amateur cryptographers, myself included, fall into the trap of overestimating the sophistication level of the average attacker by several orders of magnitude. Unless you're designing enterprise-level security to be used by large public corporations or government agencies with a lot of very valuable data to hide, the profile of your attacker is a twenty-something script kiddie with a GPU cracker looking for low-hanging fruit.
Jul
11
comment Encrypted files storage. How to simplify the password management scheme?
sCrypt should be fine on its own; its computation is both EXPTIME and EXPSPACE when both are plentiful, and to use constant space requires exponentially more time. Most implementations generate a 512-bit digest; XOR-fold that into a 256-bit AES key, generate a random IV, and you'll have a scheme I'd trust (if properly implemented; use an authenticated mode for AES, watch out for possible oracle or timing attacks, and keep all sensitive data as volatile as feasible).
Jul
10
answered Is a self-signed SSL certificate much better than nothing?
Jul
10
revised Is it possible to prove which public key was used to encrypt a message?
added 495 characters in body
Jul
10
revised Is it possible to prove which public key was used to encrypt a message?
added 495 characters in body
Jul
10
answered Is it possible to prove which public key was used to encrypt a message?
Jul
10
answered Encrypted files storage. How to simplify the password management scheme?
Jun
26
revised How to secure database table of users for an application?
added 75 characters in body
Jun
26
revised How to secure database table of users for an application?
added 75 characters in body
Jun
26
comment How to secure database table of users for an application?
This is one good solution and a general best practice, but it can be hard to implement in a mature application, especially when using an ORM or other "rich query" framework. There are other options as I cover in my answer.