TawratNibir

Sinha_mf

Feb 22nd, 2026
93
0
Never
6
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <time.h>
  5.  
  6. #include "des.h"
  7. #include "2des.h"
  8. #include "3des.h"
  9. #include "modes.h"
  10. #include "mitm.h"
  11. #include "patternLeak.h"
  12. #include "desKPTA.h"
  13.  
  14.  
  15.  
  16. #define endl printf("\n");
  17.  
  18. void printError();
  19.  
  20. int main(int argc , char* argv[]){
  21.    
  22.     clock_t start, end;
  23.     start = clock();
  24.  
  25.     int mode=0; //1 is ecb, 2 is cbc, 3 is cfb, 4 is ofb
  26.     int encryp=0; // 1 is des, 2 is 2des, 3 is 3des
  27.     int task=0;
  28.  
  29.     if(argc==2){
  30.         if(strcmp(argv[1],"--mitm")==0){
  31.             MITM();
  32.         }
  33.         else if(strcmp(argv[1],"--patternLeak")==0){
  34.             patternLeak();
  35.         }
  36.         else if (strcmp(argv[1],"--kpta")==0){
  37.             desKnownTextAttack();
  38.         }
  39.         else{
  40.             printError();
  41.         }
  42.     }
  43.     else if(argc==4){
  44.        
  45.         if(strcmp(argv[1],"--encrypt")==0) task=1;
  46.         else if(strcmp(argv[1],"--encrypt+decrypt")==0) task=3;
  47.         else if(strcmp(argv[1],"--decrypt")==0) task=2;
  48.  
  49.         if((strcmp(argv[2],"--ecb")==0||strcmp(argv[3],"--ecb")==0)&&!mode) mode=1;
  50.         if((strcmp(argv[2],"--cbc")==0||strcmp(argv[3],"--cbc")==0)&&!mode) mode=2;
  51.         if((strcmp(argv[2],"--cfb")==0||strcmp(argv[3],"--cfb")==0)&&!mode) mode=3;
  52.         if((strcmp(argv[2],"--ofb")==0||strcmp(argv[3],"--ofb")==0)&&!mode) mode=4;
  53.        
  54.         if((strcmp(argv[2],"--des")==0||strcmp(argv[3],"--des")==0)&&!encryp) encryp=1;
  55.         if((strcmp(argv[2],"--2des")==0||strcmp(argv[3],"--2des")==0)&&!encryp) encryp=2;
  56.         if((strcmp(argv[2],"--3des")==0||strcmp(argv[3],"--3des")==0)&&!encryp) encryp=3;
  57.  
  58.        
  59.         if(mode==0 || encryp==0 || task==0) printError();
  60.  
  61.         else{
  62.             unsigned char iv[8]={'a','b','c','d','e','f','g','h'};
  63.            
  64.             int key[64] = {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1};
  65.             int key2[128]={1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0};
  66.             int key3[192]={1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1};
  67.            
  68.             if(task==1){
  69.                 if(mode==1){
  70.                     if(encryp==1) ecb_encrypt(64,key, "input", "des");
  71.                     else if(encryp==3) ecb_encrypt(64,key3, "input", "3des");
  72.                     else ecb_encrypt(64,key2, "input", "2des");
  73.                 }
  74.                 else if(mode==2){
  75.                     if(encryp==1) cbc_encrypt(64,key, "input",iv, "des");
  76.                     else if(encryp==3) cbc_encrypt(64,key3, "input",iv, "3des");
  77.                     else cbc_encrypt(64,key2, "input",iv, "2des");
  78.                 }
  79.                 else if(mode==3){
  80.                     if(encryp==1) cfb_encrypt(64,key, "input",iv, "des");
  81.                     else if(encryp==3) cfb_encrypt(64,key3, "input",iv, "3des");
  82.                     else cfb_encrypt(64,key2, "input",iv, "2des");
  83.                 }
  84.                 else if(mode==4){
  85.                     if(encryp==1) ofb_encrypt(64,key, "input",iv, "des");
  86.                     else if(encryp==3) ofb_encrypt(64,key3, "input",iv, "3des");
  87.                     else ofb_encrypt(64,key2, "input",iv, "2des");
  88.                 }
  89.             }
  90.             else if(task==2){
  91.                 if(mode==1){
  92.                     if(encryp==1) ecb_decrypt(64,key, "encrypted", "des");
  93.                     else if(encryp==3) ecb_decrypt(64,key3, "encrypted", "3des");
  94.                     else ecb_decrypt(64,key2, "encrypted", "2des");
  95.                 }
  96.                 else if(mode==2){
  97.                     if(encryp==1) cbc_decrypt(64,key, "encrypted",iv, "des");
  98.                     else if(encryp==3) cbc_decrypt(64,key3, "encrypted",iv, "3des");
  99.                     else cbc_decrypt(64,key2, "encrypted",iv, "2des");
  100.                 }
  101.                 else if(mode==3){
  102.                     if(encryp==1) cfb_decrypt(64,key, "encrypted",iv, "des");
  103.                     else if(encryp==3) cfb_decrypt(64,key3, "encrypted",iv, "3des");
  104.                     else cfb_decrypt(64,key2, "encrypted",iv, "2des");
  105.                 }
  106.                 else if(mode==4){
  107.                     if(encryp==1) ofb_decrypt(64,key, "encrypted",iv, "des");
  108.                     else if(encryp==3) ofb_decrypt(64,key3, "encrypted",iv, "3des");
  109.                     else ofb_decrypt(64,key2, "encrypted",iv, "2des");
  110.                 }
  111.             }
  112.             else if(task==3){
  113.                 if(mode==1){
  114.                     if(encryp==1){
  115.                         ecb_encrypt(64,key, "input", "des");
  116.                         ecb_decrypt(64,key, "encrypted", "des");
  117.                     }
  118.                     else if(encryp==3){
  119.                         ecb_encrypt(64,key3, "input", "3des");
  120.                         ecb_decrypt(64,key3, "encrypted", "3des");
  121.                     }
  122.                     else{
  123.                         ecb_encrypt(64,key2, "input", "2des");
  124.                         ecb_decrypt(64,key2, "encrypted", "2des");
  125.                     }
  126.                 }
  127.                 else if(mode==2){
  128.                     if(encryp==1){
  129.                         cbc_encrypt(64,key, "input",iv, "des");
  130.                         cbc_decrypt(64,key, "encrypted",iv, "des");
  131.                     }
  132.                     else if(encryp==3){
  133.                       cbc_encrypt(64,key3, "input",iv, "3des");
  134.                       cbc_decrypt(64,key3, "encrypted",iv, "3des");  
  135.                     }
  136.                     else{
  137.                         cbc_encrypt(64,key2, "input",iv, "2des");
  138.                         cbc_decrypt(64,key2, "encrypted",iv, "2des");
  139.                     }
  140.                 }
  141.                 else if(mode==3){
  142.                     if(encryp==1){
  143.                         cfb_encrypt(64,key, "input",iv, "des");
  144.                         cfb_decrypt(64,key, "encrypted",iv, "des");
  145.                     }
  146.                     else if(encryp==3){
  147.                       cfb_encrypt(64,key3, "input",iv, "3des");
  148.                       cfb_decrypt(64,key3, "encrypted",iv, "3des");  
  149.                     }
  150.                     else{
  151.                         cfb_encrypt(64,key2, "input",iv, "2des");
  152.                         cfb_decrypt(64,key2, "encrypted",iv, "2des");
  153.                     }
  154.                 }
  155.                 else if(mode==4){
  156.                     if(encryp==1){
  157.                         ofb_encrypt(64,key, "input",iv, "des");
  158.                         ofb_decrypt(64,key, "encrypted",iv, "des");
  159.                     }
  160.                     else if(encryp==3){
  161.                       ofb_encrypt(64,key3, "input",iv, "3des");
  162.                       ofb_decrypt(64,key3, "encrypted",iv, "3des");  
  163.                     }
  164.                     else{
  165.                         ofb_encrypt(64,key2, "input",iv, "2des");
  166.                         ofb_decrypt(64,key2, "encrypted",iv, "2des");
  167.                     }
  168.                 }
  169.             }
  170.  
  171.         }
  172.    
  173.    
  174.    
  175.    
  176.     }
  177.     else{
  178.         printError();
  179.     }
  180.  
  181.     end = clock();
  182.  
  183.     double time_taken = (double)(end - start) / (double)(CLOCKS_PER_SEC);
  184.  
  185.     endl;
  186.     printf("Time taken is: %f sec.", time_taken); endl;
  187. }
  188.  
  189.  
  190. void printError(){
  191.     endl
  192.     printf("Incorrect Command"); endl;
  193.     printf("Please follow the following standard"); endl;
  194.     printf("./driver --(encrypt | decrypt | encrypt+decrypt ) --mode --encryption"); endl;
  195.     printf("./driver --attack"); endl;
  196.     endl;
  197.     printf("Attacks: --patternLeak --kpta --mitm"); endl;
  198.     endl;
  199.     exit(1);
  200. }
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Pyrnally
    16 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • User was banned
Add Comment
Please, Sign In to add comment