Advertisement
Guest User

Untitled

a guest
May 1st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <unistd.h>
  2. #include <iostream>
  3. #include <fstream>
  4. #include <iomanip>
  5. #include <string>
  6.  
  7. using namespace std;
  8. int main ()
  9. {      
  10. char password[17], username[17];
  11. const char salt[] = "cs";
  12.     ofstream pass;
  13.     pass.open ("password.txt");
  14.     while(1)
  15.     {
  16.         cout << "Enter a new username:\n";
  17.         cin.getline(username, 16);
  18.         pass << username;
  19.         cout << "Enter a new password:\n";
  20.         cin.getline(password, 16);
  21.         password = crypt(password, salt);
  22.         pass << password;
  23.        
  24.     }
  25.     pass.close();
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement