summaryrefslogtreecommitdiff
path: root/CryptClass/HASHCrypt.hpp
blob: 6090c92f139a81d0b9acabc7c06e2742a872a9a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//----- Includes std -----

#include <string>


//----- Includes crypto++ -----

//Pour le calcule de la somme de controle MD5
#include <crypto++/md5.h>
//Pour la convertion en hexadécimal et vice-versa
#include <crypto++/hex.h>


/*----- Description -----
Classe executant divers fonctions de hachage sur
un paramètre donné à l'initialisation, ainsi celui-ci
n'est présent en mémoire qu'à l'initialisation.
Utilise la bibliothèque crypto++
*/

class HASHCrypt{

    public:
        //Constructeur
        HASHCrypt(std::string chain);

        //Destructeur
        ~HASHCrypt();

        std::string getMD5_32();    //Retourne MD5_32
        std::string getMD5_128();   //Retourne MD5_128



    private:
        //Calcule de MD5 sur 32bits
        std::string initMD5_32(std::string chain);

        //Calcule de MD5 sur 128 bits
        std::string initMD5_128(std::string chain);


        std::string MD5_32;   //Attribut MD5 sur 32bits
        std::string MD5_128;  //Attribut MD5 sur 128 bits


};