I am trying to build website that will encrypt some data for the user using his/her the output of scrypt on it, now the idea is that this schema is not flexible because if the user loose their password then all of their data is lost, instead came to following options:
Option 1 :
Generate random 128 bit key $k_1$
Generate random 128 bit recovery key $k_2$
Run scrypt on user password to get $k_3$
Give $k_2$ to user to save it in secure place and not save it in database
Encrypt $k_1$ once with $k_2$ and once with $k_3$ and once with $k_2$ and store them in database
When user forget their password he/she uses $k_2$ to decrypt the encryption key $k_1$ and then go to step 2.
Option 2:
Generate random 128 bit key $k_1$
Generate random 128 bit recovery key $k_2$
Use scrypt on user password to derive $k_3$
$k_4 = k_1 \oplus k_2$
$k_5 = k_1 \oplus k_3$
To encrypt we use the $k_1 = k_4 \oplus k_5$
Give $k_2$ to user to save it in secure place and not store it in database
When a user forgets their password he/she provides the system with $k_2$, then $k_1 = k_3 \oplus k_2$, go to step 2
Option 3:
Use scrypt on user given password, this will be $k_1$
Generate random 128 bit key for encryption $k_2$
Encrypt $k_2$ with $k_1$
Use Shamir shared secret with number of shares is $2$ and threshold is $2$ and the secret is $k_1$
Store share in database $s_1$, and give the other $s_2$ to the user to save it in secure place.
When a user forgets their password she/he will provide the system with his/her sahmir shared $s_2$, and using shamir secret sharing algorithm and the $s_1$ we obtain $k_1$ and then go to step 1.
Now my exact question is: What is the pro and cons for option 1, option 2 and option 3? Which one will be the most secure one? And which one will be the best from a performance perspective?