NK
Size: a a a
NK
NK
CD
AS
NK
NK
K
NK
K
NK
K
T
T
#include <cstring>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <openssl/md5.h>
// to print MD5
void printMD5(unsigned char* md, long size = MD5_DIGEST_LENGTH) {
for (int i=0; i<size; i++) {
std::cout<< std::hex << std::setw(2) << std::setfill('0') << (int) md[i];
}
}
int main(int argc, char** argv)
{
if (argc != 2) { std::cout << "You must input an string value as the argument"; return -1; };
unsigned char md5_result[MD5_DIGEST_LENGTH];
const unsigned char* pincode = reinterpret_cast<unsigned char*>(argv[1]) ;
MD5(pincode, strlen( reinterpret_cast<const char*>(pincode) ) , md5_result);
printMD5(md5_result);
std::cout << std::endl;
}
T
ПК
ПК
з
K
K