Nav apraksta

shamain.cpp 777B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include "sha256.h"
  3. // #include <stdio.h>
  4. // #include < string.h >
  5. void crypt_and_print(char input[])
  6. {
  7. char result[65];
  8. char diff[65] = "00000";
  9. char *istr;
  10. char buffer2[20];
  11. int temp;
  12. char str2[20];
  13. for (int i = 0; i < 1; i++)
  14. {
  15. char string[] = "xqqq";
  16. sprintf(buffer2, "%d", i);
  17. temp = 8 - strlen(buffer2);
  18. str2[0] = '\0';
  19. while (strlen(str2) != temp)
  20. strcat(str2, "0");
  21. strcat(str2, buffer2);
  22. strcat(string, str2);
  23. sha256_crypt(string, result);
  24. istr = strstr(result, diff);
  25. if (istr != NULL) {
  26. printf(istr);
  27. break;
  28. }
  29. }
  30. }
  31. int main()
  32. {
  33. char result[65];
  34. sha256_init(2048);
  35. crypt_and_print((char*)"");
  36. }