hey, i'm using CryptoSys API for encryption, and i got a program to successfully encrypt using the SHA1 algorithm....but how do i un-SHA1 the information? lol
thanks
Printable View
hey, i'm using CryptoSys API for encryption, and i got a program to successfully encrypt using the SHA1 algorithm....but how do i un-SHA1 the information? lol
thanks
define:hash
- A mathematical formula that converts a message of any length into a unique fixed-length string of digits (typically 160 bits) known as "message digest" that represents the original message. A hash is a one-way function - that is, it is infeasible to reverse the process to determine the original message. Also, a hash function will not produce the same message digest from two different inputs.
- A one-way algorithm which maps or translates one set of bits into another (generally smaller) in such a way that the algorithm yields the same hash results every time for the same message, and it is computationally infeasible for a message to be reconstituted from the hash result. Also, two different messages cannot produce the same hash results.
You can't! You don't! If you want to be able to recover your plaintext, use an encryption algorithm, not a hashing algorithm.
hahah.
good point... :-[
liiiiike..? ;)
mm..however much names of encryption algorithms help...they dont, tutorials / source help. :) thanks!
mm..in case it matters: OS - Windows XP Pro SP2
Dev-C++ 4.9.9.2
AES?
hMm....not to be a [Shift]+244, but..Quote:
mm..however much names of encryption algorithms help...they dont, tutorials / source help. :) thanks!
i know OF encryption methods such as AES, its predecessor DES, blowfish.....but i dont know how to use them. i even have the prototypes defined in the diCryptoSys.h header file..and i could take a stab at implementing them, but i'd prly be wrong. lolCode:/* AES-256 PROTOTYPES */
long _stdcall AES256_Bytes(unsigned char *output, const unsigned char *input,
long nbytes, const unsigned char *key, int bEncrypt);
long _stdcall AES256_BytesMode(unsigned char *output, const unsigned char *input,
long nbytes, const unsigned char *key, int bEncrypt,
const char *lpszMode, const unsigned char *iv);
long _stdcall AES256_Hex(char *lpszOutput, const char *lpszInput,
const char *lpszKey, int bEncrypt);
long _stdcall AES256_HexMode(char *lpszOutput, const char *lpszInput,
const char *lpszKey, int bEncrypt, const char *lpszMode, const char *lpszIV);
long _stdcall AES256_File(const char *lpszFileOut, const char *lpszFileIn,
const unsigned char *key, int bEncrypt, const char *lpszMode, const unsigned char *iv);
long _stdcall AES256_FileHex(const char *lpszFileOut, const char *lpszFileIn,
const char *lpszKey, int bEncrypt, const char *lpszMode, const char *lpszIV);
long _stdcall AES256_Init(const unsigned char *key,
int bEncrypt, const char *lpszMode, const unsigned char *iv);
long _stdcall AES256_InitHex(const char *lpszKey, int bEncrypt,
const char *lpszMode, const char *lpszIV);
long _stdcall AES256_Update(long ctx_handle, unsigned char *data, long dataLen);
long _stdcall AES256_UpdateHex(long ctx_handle, char *lpszHex);
long _stdcall AES256_Final(long ctx_handle);
long _stdcall AES256_InitError(void);
/* BLOWFISH PROTOTYPES */
long _stdcall BLF_Hex(char *sOutput, const char *sInput,
const char *sKey, int bEncrypt);
long _stdcall BLF_HexMode(char *sOutput, const char *sInput,
const char *sHexKey, int bEncrypt, const char *sMode, const char *sHexIV);
long _stdcall BLF_Bytes(unsigned char *output, const unsigned char *input,
long nbytes, const unsigned char *key, long keyBytes, int bEncrypt);
long _stdcall BLF_BytesMode(unsigned char *output, const unsigned char *input,
long nbytes, const unsigned char *key, long keyBytes,
int bEncrypt, const char *sMode, const unsigned char *iv);
long _stdcall BLF_File(const char *sFileOut, const char *sFileIn,
const unsigned char *key, long keyBytes, int bEncrypt,
const char *sMode, const unsigned char *iv);
long _stdcall BLF_FileHex(const char *sFileOut, const char *sFileIn,
const char *sHexKey, int bEncrypt, const char *sMode, const char *sHexIV);
long _stdcall BLF_Init(const unsigned char *key,
long keyBytes, int bEncrypt,
const char *sMode, const unsigned char *iv);
long _stdcall BLF_InitHex(const char *sHexKey, int bEncrypt,
const char *sMode, const char *sHexIV);
long _stdcall BLF_UpdateHex(long ctx_handle, char *sHexData);
long _stdcall BLF_Update(long ctx_handle, unsigned char *data,
long dataLen);
long _stdcall BLF_Final(long ctx_handle);
long _stdcall BLF_Ecb(long ctx_handle, unsigned char *data,
long dataLen, int bEncrypt);
long _stdcall BLF_EcbHex(long ctx_handle, char *sHexBlock, int bEncrypt);
long _stdcall BLF_InitError(void);
thanks tho :)
also..for SHA1 i had declared char digest[41]; to hold the hashed string..if i were going to use SHA-256..whats size of an array would i have to declare? char digest[64]?
thanks^3, lol