Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <string>
- using namespace std;
- int main ()
- {
- char password[17], username[17];
- const char salt[] = "cs";
- ofstream pass;
- pass.open ("password.txt");
- while(1)
- {
- cout << "Enter a new username:\n";
- cin.getline(username, 16);
- pass << username;
- cout << "Enter a new password:\n";
- cin.getline(password, 16);
- password = crypt(password, salt);
- pass << password;
- }
- pass.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement