AES128ESP32 Library
Loading...
Searching...
No Matches
pbkdf2.h
Go to the documentation of this file.
1#pragma once
2#include "AES128ESP32.h"
3// #include <Arduino.h>
4// #include <psa/crypto.h>
5// #include "delays.h"
6
7// masterkey type is based on PSA_ALG_HKDF(PSA_ALG_SHA_256)
8// which requires 32 bytes
9
13// put whatever you want to in here, but do not make it empty/blank.
14#define MSTRKEYSALT "Something Random"
15
27
28// known issues:
29// todo: add salt generation
30
31class pass2Key {
32 psa_key_id_t masterkeyid = 0;
33 psa_key_id_t newkeyid = 0;
34#ifdef DEBUGLEVEL
35 String derivedkeytext;
36#endif
37 friend class cryptoAES128;
38public:
39 pass2Key();
40 ~pass2Key();
41
42 bool getMasterKey(MasterKeyData &mkd);
43 bool setMasterKey(MasterKeyData &mkd);
44 bool makeMasterKey();
45 bool deriveNewKeyfromText(String text);
46private:
47 psa_key_attributes_t getattributes(bool formaster = false);
48};
bool setMasterKey(MasterKeyData &mkd)
Definition pbkdf2.cpp:69
~pass2Key()
Definition pbkdf2.cpp:14
friend class cryptoAES128
Definition pbkdf2.h:37
bool makeMasterKey()
Definition pbkdf2.cpp:117
bool getMasterKey(MasterKeyData &mkd)
Definition pbkdf2.cpp:40
pass2Key()
Definition pbkdf2.cpp:6
bool deriveNewKeyfromText(String text)
Definition pbkdf2.cpp:154
masterkey data for AES128 is 16bytes