i would like the code.....

This is a discussion on i would like the code..... within the C++ Programming forums, part of the General Programming Boards category; can some one give me the code to make a small program that could passcode my programms and allplication so ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    18

    i would like the code.....

    can some one give me the code to make a small program that could passcode my programms and allplication so only i could use it

    for c++,, (dev c++)

    ^.^
    The woundeful Joseph Goss,,,
    e-mail me "nerdyneo@hotmail.com"
    if you want
    Ermmm,,... hello anyone there?
    i am 15

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    just put a password/login on all your programs?

    if you want a quick, insecure way, try something like this:
    Code:
    #include<iostream>
    #include<fstream>
    
    using std::cin;
    using std::cout;
    using std::ifstream;
    
    int main()
    {
       char*pword=new char[10];
       char*fpword=new char[10];
    
       ifstream infile("C:\\somewhere\\somewhere\\something.dat");
       ifstream>>fpword;
       infile.close();
    
       cout<<"Enter Password: ";
       cin>>pword;
       if(strcmpi(pword,fpword))
       {
          /* PUT PROGRAM HERE */
       }
       else
       {
          cout<<"Stop trying to crack my software!";
          return 0;
       }
       
       delete[]fpword;
       delete[]pword;
    }
    Last edited by major_small; 10-31-2003 at 11:44 AM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    18
    Originally posted by major_small
    just put a password/login on all your programs?
    what i did not understand very well

    ^.^
    The woundeful Joseph Goss,,,
    e-mail me "nerdyneo@hotmail.com"
    if you want
    Ermmm,,... hello anyone there?
    i am 15

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Here's a quick outline...

    1. Define a string with the known correct password.
    2. Display a message asking the user to enter the password.
    3. Get the user's string.
    4. Compare the strings.
    5. If the strings match, continue (or return "true", etc). If the strings don't match, return 0.

    If you want to get fancy, you can add an option to change the password and save it to a file... maybe encrypted.

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Originally posted by nerdyneo
    what i did not understand very well

    ^.^
    i was posting code while you were posting a reply...

    Originally posted by DougDbug
    If you want to get fancy, you can add an option to change the password and save it to a file... maybe encrypted.
    my code got a little fancy and reads it from a file, so you can have all your programs read the same file and use the same password and you can change it for all programs easily...

    for encryption, I suggest something like this:
    Code:
    ...
    for(int i=0;i<strlen(fpword);i++)
       fpword[i]=static_cast<char>(static_cast<int>(fpword[i])+5);
    ...
    and for a decryption algorithm jsut put a minus in front of the 5 (or whatever number you want to use)

    once again, this isn't very secure at all, but it doesn't seem like you're trying to block your apps from the CIA, either...
    Last edited by major_small; 10-31-2003 at 11:47 AM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 08:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 03:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 05:05 PM

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