brauche hilfe bei c++ password verschlüsseln



  • hi leute,
    ich habe ein programm um es zu starten muss man ein passwort eingeben.
    doch das passwort soll zensirt werden z.b. stat geheim = ******
    hier der code

    #include <iostream>
    #include<windows.h>
    //für  die farben
    #define blau    9
    #define turkise 11
    #define gruen   10
    #define rot     4
    #define gelb    14
    #define grau    8
    #define white   15
    #define black   0
    void textcolor(WORD color)           //Funktion fuer Farbe 
    { 
        SetConsoleTextAttribute(::GetStdHandle(STD_OUTPUT_HANDLE), color); 
    } 
    bool Fullscreen()
        {
         static bool bFullscreen = false;
          keybd_event(VK_MENU,0x38,0,0);
          keybd_event(VK_RETURN,0x1c,0,0);
          keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
          keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
         return bFullscreen = !bFullscreen;
        }
        int f,t,r,m,n,o;
        char pass3[]="yannicST";           
        char pass4[10];
        char str2[10];
        char str1[]="a4mt" ;           
        char pass2[10];
        char pass1[]="gut" ;
    
          int main()
          {
          textcolor(15); 
          printf("Enter username:\n");
          gets (pass4);
          n=strcmp (pass3, pass4);
          if(n==0)
              {
              Sleep(800);
              }
          else
              {
              textcolor(4);
              printf("!! Username is incorect !!");
              for(int o = 0; o < 100000000 ; o++)
                  {
                   printf("\a");
                   Sleep(500);
                   }
              printf("!! EXIT !!");
              Sleep(900);
              return 0;
              }
          textcolor(15);
          printf("Enter password:\n");
          textcolor(0);
          gets (str2);
          r=strcmp(str1, str2);
          textcolor(15);
          if(r==0)
          {
          Sleep(1000);
          }
          else
          {
             textcolor(4);
             printf("!! Passwot is incorect !!");
             for(int f = 0; f < 100000000 ; f++)
                {
                printf("\a");
                Sleep(500);
                }
             textcolor(4);
             printf("    EXIT NOW!!!");
             Sleep(900);
             return 0;
          }
          textcolor(10);
          printf("Willkommen");
          textcolor(15);
          printf("\a");
          printf(" wie geht es ihnen?");
          gets (pass2);
          t=strcmp (pass1, pass2);
          if(t==0)
              {
              textcolor(10);
              printf("Das ist toll!");
              textcolor(15);
              }
    
          else
              {
               printf("Das ist  sehr schade");
              }
              getchar();
              }
    


  • Was hat dieser Code bitte noch mit C++ zu tun 😕

    Würde mal sagen das gehört ins C-Subforum.

    Aber wieso hast du nicht erst mal kurz gegoogelt ich hab nicht mal ne Minute gebraucht.....http://lmgtfy.com/?q=c%2B%2B+in+der+konsole+sternchen+bei+eingabe

    Lg freeG


Anmelden zum Antworten