Function mosaic::dpapi_decrypt#

Function Documentation#

QString mosaic::dpapi_decrypt(const QString &stored)#

Reverses dpapi_encrypt().

A string that doesn’t start with the "dpapi:v1:" marker is assumed to be a pre-existing plaintext value from before this feature existed (or a non-Windows build) and is returned unchanged — no migration step is needed, since the very next save re-encrypts it via dpapi_encrypt().

If the marker IS present but decryption fails (e.g. the settings file was copied to a different machine or user account, or the blob is corrupted), returns an empty string with a logged warning — surfacing the problem by making the field visibly empty rather than returning silently wrong bytes.