# How do single use passwords work for an encrypted message

LastPass encrypts its data before sending it to their servers. The key for the data is generated using a combination of the master password and username.

How then can a one-time password be used to decrypt this data? The data on the server has been encrypted with the master password and username. Does this mean that LastPass stores a new version of encrypted data for every (single-use) password?

-

They key for the data should be generated in a way that also involves salt. $\hspace{2.2 in}$ (I have no other reason to believe that it actually is.) $\:$ – Ricky Demer Jan 12 at 19:18

## 2 Answers

As hunter notes, the only people who can really say what LastPass actually does are those who work there. However, as long as we only consider what they can and should do...

They don't really need to store a separate copy of your data for each one-time password. Instead, all they need to store for each password is an encrypted copy of the key used to actually encrypt the data.

So, when you log in using a one-time password, the password is (presumably) passed through PBKDF2 to derive a "key-encryption key", which is then used to decrypt the actual key needed to decrypt the data.

-

– hunter Jan 15 at 16:24
@hunter: I suppose they might derive the actual encryption key directly using PBKDF2 from the user's permanent password, and then save an encrypted copy of that key for each one-time password. Or the statement on the website might just be missing some details. – Ilmari Karonen Jan 16 at 2:48

The only people who can answer your question definitively are the programmers at LastPass, however, I'll try.

I assume you're referring to this. If LastPass really does encrypt your data with your password/username, then logically it could only be decrypted with the same key.

Their 'one-time' password feature is an interesting idea, but I'm dubious about it. They use 256-bit AES to encrypt your data - this is symmetrical encryption, which means that there's only one single key used for encryption/decryption.

In answer to your question, yes - it would make sense that they would have to create/store a copy of your data, encrypted with the 'one-time' password, for each one-time password that you create.

The only way (that I can think of) to avoid making a separate copy of your data for each 'one-time' password is if there is a server-side 'back-door' into your account, which would put your data at extreme risk (but I doubt this is the case).

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9439888596534729, "perplexity_flag": "middle"}