Thread: encrypt

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    2

    encrypt

    I'm trying to encrypt this char array using pointer subscript notation and I need help with the algorithm. I don't understand how the ENCRYPTION_KEY affects the encryption and how to utilize it.
    Code:
    #include<iostream>
    #include<conio.h>
    #include<string>
    #include<cstring>
    
    using namespace std;
    
    
    //encrypt(char *ptr);
    const int ENCRYPTION_KEY = 1;
    void main()
    {
    
    char temp1[26];
    char temp2[26];
    char password[11];
    char *ptr;
    
    cout<<"Please enter a password no more than 25 characters in length: ";
    cin>>temp1;
    cout<<temp1;
    cout<<"Re-enter your password: "<<endl;
    cin>>temp2;
    cout<<temp2<<endl;
    cout<<strcmp(temp1, temp2)<<endl;
         while (strcmp(temp1, temp2) !=0){
                cout<<"Invalid Password"<<endl;
                cout<<"Re-enter your password: "<<endl;
    	        cin>>temp2;
    			}
    
    	 strncpy (password, temp1, 11);
    	 password[10]='\0';
                     cout<<password<<endl;
                     ptr=password;
    
     //encrypt(ptr);
     getch();
     }
    
    //void encrypt(char *ptr)
          //{
           //for (i =0; i<11; i++)
           //ptr[i] 
    	//}

    &#91;code]&#91;/code]tagged by Salem

  2. #2
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    I don't know what you meant by the encryption key?
    But I think that it should be the base you will do the encryption based on.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to decrypt / encrypt using libgcrypt ? (ARC4)
    By jabka in forum C Programming
    Replies: 6
    Last Post: 04-21-2010, 11:34 PM
  2. Strange issue utilizing encrypt() in libcrypt
    By TheComedian in forum C Programming
    Replies: 8
    Last Post: 01-18-2009, 07:14 AM
  3. dll to encrypt packet sends
    By splintter in forum C++ Programming
    Replies: 22
    Last Post: 04-20-2008, 09:00 PM
  4. encrypt input message
    By axedia in forum C Programming
    Replies: 1
    Last Post: 05-30-2005, 12:48 AM
  5. Ask about Encrypt data 2 times.
    By ooosawaddee3 in forum C++ Programming
    Replies: 1
    Last Post: 07-16-2002, 03:28 AM