Skip to content

Need help to understand to understand encryption. #409

Open
@AdityaPahilwani

Description

@AdityaPahilwani

Thanks a lot for creating this super-fast storage library.

I was exploring encryption with MMKV and have some doubts, would be really grateful if you can help me with the same.

While creating an instance of MMKV we give one encryption key, and we provide a unique key which is 99% the same throughout app lifecycle

const encryptionKey=NativeFunctionToRetrieveUniqueID();
// for ex encryptionKey value is mmkv-is-great
export const Storage = new MMKV({
	id: `storage`,
	encryptionKey: encryptionKey,
})

now if by any chance NativeFunctionToRetrieveUniqueID gives another key which is not the same key which was used to create the instance.

const encryptionKey=NativeFunctionToRetrieveUniqueID();
// for ex encryptionKey value is 'mmkv-is-fast' instead of last used key which was 'mmkv-is-great'
export const Storage = new MMKV({
	id: `storage`,
	encryptionKey: 'encryptionKey',
})

As the encryption key is changed would it do any harm? like data is getting failed to read or any possible harm?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions