Security Login Daemon

This is a discussion on Security Login Daemon within the C++ Programming forums, part of the General Programming Boards category; Could someone fix this for me? Code: // Troy Curless // Security Login Application #include <iostream> #include <string> //specific functions ...

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    450

    Security Login Daemon

    Could someone fix this for me?
    Code:
    // Troy Curless
    // Security Login Application
    #include <iostream>
    #include <string>
    
    //specific functions of the std C++ iostream library
    using std::cout;
    using std::endl;
    
    void enter(time void)
    {
       cout << "Welcome, could you repeat your password please."<< endl;
       cin >> password;
       if (password == password) 
         cout >> "Maybe you would like in but I am not sure."  >> endl;
         cin >> password;
         while (true)
         {
            seed(password[random(seed(void))]);
            password = random(password[seed]);
            
            cout << "Nice to meet you, haXor!" << endl;
            
            password = password xor password[for (int i=1; i<length.password; ++i);
            vector<string> password = password;
         }
    }
    
         
    int main(int argc, char **argv)
    {
      Entrance:   
    
       cout << "Please enter your password:";
       
       string password = "open seasame";
       
       cin >> password;
       
       if (password = password)
         enter(void);
       
       goto Entrance;
    }

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,163
    You could start off by posting it in the correct forum. This one is for C, not C++.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154
    I've only had a really quick look, so there might be more that what I saw, but you have inverted the << operator at one part.
    Code:
    cout >> "Maybe you would like in but I am not sure."  >> endl;

  4. #4
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    Quote Originally Posted by itsme86
    You could start off by posting it in the correct forum. This one is for C, not C++.
    In addition, it's usually helpful to post error messages instead of a simple request to "fix this".
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  5. #5
    He's trying.
    Join Date
    Apr 2005
    Location
    Missouri, US
    Posts
    70
    Code:
       string password = "open seasame";
       
       cin >> password;
       
       if (password = password)
    Pray tell, what is this ... umm.. intended to do?

    I might be misunderstanding something, but you set the variable password to "Open seasame", then ask the user to input something to password (thus overwriting the old value, neh?), and then
    1) Compare password to...itself...and
    2) Use a single equal sign instead of the comparison operator (==)

    Hm.

  6. #6
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Here you go:
    Code:
    // Troy Curless
    // Security Login Application
    #include <iostream>
    #include <string>
    
    //specific functions of the std C++ iostream library
    using std::cout;
    using std::endl;
    
    
    int main()
    {
        cout<<"hello world"<<endl;
    
        return 0;
    }

  7. #7
    Super Moderater.
    Join Date
    Jan 2005
    Posts
    374
    What exactly do you want this to do? What is the 'random' seed doing? Explain.


  8. #8
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    I just use something like this:
    Code:
    for(;;){ 
    cin>>password;
    if(password == "MyPassword")
    break;
    else
    cout<<"Sorry, wrong password!"<<endl; }
    cout<<"Correct password inputed!"<<endl;
    I also noticed that you used this:
    Code:
     
    //specific functions of the std C++ iostream library
    using std::cout;
    using std::endl;
    You could just use this:
    Code:
    using namespace std;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. unable to login to facebook
    By zykostar in forum C# Programming
    Replies: 4
    Last Post: 03-30-2010, 02:04 PM
  2. Login
    By brietje698 in forum C++ Programming
    Replies: 3
    Last Post: 10-07-2007, 09:51 AM
  3. Daemon problem
    By gandalf_bar in forum Linux Programming
    Replies: 3
    Last Post: 07-20-2004, 06:23 AM
  4. Security on automated home
    By stimpyzu in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-11-2004, 01:14 AM
  5. login script - URGENT!!!
    By linzeeuk in forum C Programming
    Replies: 5
    Last Post: 05-05-2003, 02:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21