Password hardening for elliptic curve integrated encryption schemes
Methods, systems, and devices for data management are described. The described techniques may enable a user to password harden a ciphertext including a first elliptic curve point and an encrypted message such that an unauthorized user may query an enclave multiple times to decrypt the message. For example, the user may generate a second elliptic curve point using a user-provided password and modify the ciphertext using the second elliptic curve point. The user may decrypt the message by restoring the ciphertext and querying the enclave using the restored ciphertext. Accordingly, an unauthorized user may not obtain the message from the enclave unless the unauthorized user obtains the user-provided password or queries the enclave more than once.
1 . A method for encryption, comprising:
encrypting a message using a public key associated with a private key, the private key being stored in a secure enclave of a computing device, wherein the encryption of the message outputs a first ciphertext comprised of a first elliptic curve point and an encrypted message;
receiving a user-provided password;
generating a second elliptic curve point using the user-provided password;
obtaining a third elliptic curve point using the first elliptic curve point and the second elliptic curve point;
modifying the first ciphertext based at least in part on the third elliptic curve point resulting in a modified ciphertext;
receiving the user-provided password and a request to decrypt the encrypted message;
generating a second ciphertext using the user-provided password and the modified ciphertext;
providing, to the secure enclave, an indication of the request to decrypt the encrypted message and the second ciphertext; and
receiving, from the secure enclave in response to the indication and based at least in part on the second ciphertext being the same as the first ciphertext, the message decrypted using the private key stored in the secure enclave.
2 . The method of claim 1 , wherein generating the second ciphertext comprises:
generating the second elliptic curve point using the user-provided password;
generating the first elliptic curve point using the second elliptic curve point and the third elliptic curve point; and
generating the second ciphertext based at least in part on the first elliptic curve point.
3 . The method of claim 1 , wherein generating the second elliptic curve point comprises:
hashing one or more values of the user-provided password to obtain a first coordinate of the second elliptic curve point; and
computing a second coordinate of the second elliptic curve point based at least in part on the first coordinate.
4 . The method of claim 1 , wherein encrypting the message comprises:
encrypting the message based at least in part on a configuration of the secure enclave of the computing device.
5 . The method of claim 4 , wherein:
the configuration supports an elliptic curve integrated encryption scheme (ECIES) protocol; and
the message is encrypted based at least in part on the ECIES protocol.
6 . The method of claim 4 , wherein:
the configuration supports an elliptic curve Diffie-Hellman key exchange (ECDH) protocol; and
the message is encrypted based at least in part on the ECDH protocol.
7 . The method of claim 4 , wherein:
the configuration supports one or more symmetric cryptographic operations; and
the message is encrypted based at least in part on the one or more symmetric cryptographic operations.
8 . An apparatus for encryption, comprising:
one or more memories storing processor-executable code; and
one or more processors coupled with the one or more memories and individually or collectively operable to execute the code to cause the apparatus to:
encrypt a message using a public key associated with a private key, the private key being stored in a secure enclave of a computing device, wherein the encryption of the message outputs a first ciphertext comprised of a first elliptic curve point and an encrypted message;
receive a user-provided password;
generate a second elliptic curve point using the user-provided password;
obtain a third elliptic curve point using the first elliptic curve point and the second elliptic curve point;
modify the first ciphertext based at least in part on the third elliptic curve point resulting in a modified ciphertext;
receive the user-provided password and a request to decrypt the encrypted message;
generate a second ciphertext using the user-provided password and the modified ciphertext;
provide, to the secure enclave, an indication of the request to decrypt the encrypted message and the second ciphertext; and
receive, from the secure enclave in response to the indication and based at least in part on the second ciphertext being the same as the first ciphertext, the message decrypted using the private key stored in the secure enclave.
9 . The apparatus of claim 8 , wherein, to generate the second ciphertext, the one or more processors are individually or collectively operable to execute the code to cause the apparatus to:
generate the second elliptic curve point using the user-provided password;
generate the first elliptic curve point using the second elliptic curve point and the third elliptic curve point; and
generate the second ciphertext based at least in part on the first elliptic curve point.
10 . The apparatus of claim 8 , wherein, to generate the second elliptic curve point, the one or more processors are individually or collectively operable to execute the code to cause the apparatus to:
hash one or more values of the user-provided password to obtain a first coordinate of the second elliptic curve point; and
compute a second coordinate of the second elliptic curve point based at least in part on the first coordinate.
11 . The apparatus of claim 8 , wherein, to encrypt the message, the one or more processors are individually or collectively operable to execute the code to cause the apparatus to:
encrypt the message based at least in part on a configuration of the secure enclave of the computing device.
12 . The apparatus of claim 11 , wherein:
the configuration supports an elliptic curve integrated encryption scheme (ECIES) protocol; and
the message is encrypted based at least in part on the ECIES protocol.
13 . The apparatus of claim 11 , wherein:
the configuration supports an elliptic curve Diffie-Hellman key exchange (ECDH) protocol; and
the message is encrypted based at least in part on the ECDH protocol.
14 . The apparatus of claim 11 , wherein:
the configuration supports one or more symmetric cryptographic operations; and
the message is encrypted based at least in part on the one or more symmetric cryptographic operations.
15 . A non-transitory computer-readable medium storing code for encryption, the code comprising instructions executable by one or more process ors to:
encrypt a message using a public key associated with a private key, the private key being stored in a secure enclave of a computing device, wherein the encryption of the message outputs a first ciphertext comprised of a first elliptic curve point and an encrypted message;
receive a user-provided password;
generate a second elliptic curve point using the user-provided password;
obtain a third elliptic curve point using the first elliptic curve point and the second elliptic curve point;
modify the first ciphertext based at least in part on the third elliptic curve point resulting in a modified ciphertext;
receive the user-provided password and a request to decrypt the encrypted message;
generate a second ciphertext using the user-provided password and the modified ciphertext;
provide, to the secure enclave, an indication of the request to decrypt the encrypted message and the second ciphertext; and
receive, from the secure enclave in response to the indication and based at least in part on the second ciphertext being the same as the first ciphertext, the message decrypted using the private key stored in the secure enclave.
16 . The non-transitory computer-readable medium of claim 15 , wherein the instructions to generate the second ciphertext are executable by the one or more processors to:
generate the second elliptic curve point using the user-provided password;
generate the first elliptic curve point using the second elliptic curve point and the third elliptic curve point; and
generate the second ciphertext based at least in part on the first elliptic curve point.
17 . The non-transitory computer-readable medium of claim 15 ,
wherein the instructions to generate the second elliptic curve point are executable by the one or more processors to:
hash one or more values of the user-provided password to obtain a first coordinate of the second elliptic curve point; and
compute a second coordinate of the second elliptic curve point based at least in part on the first coordinate.