Project in ProLab (defense) C++

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Project in ProLab (defense) C++

    for a long time i'm not asking for a help here..here i am now..asking for your help in our final project in programming..please help me how to encrypt and decrypt a text using C++..the encryption and decryption will base on a txt file called subtable which has a 2 column ascii conversion table..for further explanations, i repeat and explain it further..there is a file named subtable.txt..inside it is the conversion table of an upper and lower case letters, numbers and special characters..example:
    PHP Code:
    A 100
    B 200
    C 300
    1 009
    2 008
    3 007
    1
    2
    # 3

    only space will divide the character and its ascii character..then create a program that will encrypt and decrypt a text from an existing file for example named file.txt..it will be read using fopen() read mode and then using fputc() to put or write it on a text file which is now encrypted basing fom the subtable..then create a code now to decrypt the encrypted file which will have the same text with file.txt..thanks for those who will be attempting to help me..it would be much appreciated..thanks again..graduate students..pls help me..
    Last edited by kiLLeR-eyEd_14; 13.03.10, 00:13. Reason: wrong grammar
    My Blog: http://jhommark.blogspot.com
    My Facebook: http://www.facebook.com/jhommark
    My Official Site: http://www.undergroundweb.tk
    My Community Site: http://undergroundwap.xtreemhost.com

    #2
    LOL this is PHP FORUM
    com site: http://vampist.net
    download site: http://wapdloads.net
    fb: http://www.facebook.com/pmplx

    Comment


      #3
      try my code
      Code:
      #include <iostream >
      using std :: cout;
      using std :: endl;
      void encrypt( char [ ] ); // prototypes of functions used in the code
      void decrypt( char * ePtr );
      int main( )
      {
      // create a string to encrypt
      char string[ ] = "this is a secret!";
      cout << "Original string is: " << string << endl;
      encrypt( string );
      // call to the function encrypt( )
      cout << "Encrypted string is: " << string << endl;
      decrypt( string );
      // call to the function decrypt( )
      cout << "Decrypted string is: " << string << endl;
      return 0;
      }// main
      
      //encrypt data
      void encrypt (char e[] ) 
      {
      for( int i=0; e[i] != '\0'; ++i ) ++e[i];
      } // encrypt
      
      //decrypt data
      void decrypt( char * ePtr ) {
      for( ; * ePtr != '\0'; ==* ePtr ) --(* ePtr);
      }

      DONT FORGET TO CLICK THANKS


      outpUT:
      original String: ----------------

      Encrypted string is: uijt!jt!b!tfdsfu"

      Decrypted string is: this is a secret!






      try this

      Code:
      //Encrypt the text
      string encrypt(string text, string message)
       
        		{
      		int i;
         	string temp;
       
       
      		cout << "Enter the text you wish to encrypt." << endl;
      		cin >> text;
       
       
      		for (i = 0; i < message.length(); ++i)
            temp = 3 + (text[i] - '0') ;
       
      		cout << "Encrypted text is " << temp << endl;
       
      		}
       
      //Decrypt the text
      string decrypt(string text, string message)
       
        		{
      		int i;
         	string temp;
       
       
      		cout << "Enter the text you wish to decrypt." << endl;
      		cin >> text;
       
       
      		for (i = 0; i < message.length(); ++i)
            temp = 3 + (text[i] - '0');
       
      		cout << "Decrypted text is " << temp << endl;
      		}

      you dont need open source for getting ASCII or etc txt file for converting because theres a function in cpp that will do this thing LOL





      DON't FORGET TO CLICK THANKS
      Last edited by wapmetal; 13.03.10, 03:32.
      com site: http://vampist.net
      download site: http://wapdloads.net
      fb: http://www.facebook.com/pmplx

      Comment


        #4
        i've also done this mate..encrypting and decrypting a text is very easy to do in my own way..but we need to follow what our prof instructed to do..we need to create a file named subtable.txt which has the conversion table like what i've previously posted..and this file should be read using fopen() read mode..a character will be read in the subtable and get its ascii code..then put that ascii code into a text file..that's the encrypted one..
        Last edited by kiLLeR-eyEd_14; 13.03.10, 03:55.
        My Blog: http://jhommark.blogspot.com
        My Facebook: http://www.facebook.com/jhommark
        My Official Site: http://www.undergroundweb.tk
        My Community Site: http://undergroundwap.xtreemhost.com

        Comment


          #5
          ah ok tnt


          i can do this without the help to others you just need to study World Wide Web

          @


          GOOGLE.COM
          Last edited by wapmetal; 13.03.10, 03:56.
          com site: http://vampist.net
          download site: http://wapdloads.net
          fb: http://www.facebook.com/pmplx

          Comment


            #6
            it should be like this..the subtable.txt has a conversion tableformat is <character><space><ascii code> then break line..
            PHP Code:
            A x0
            B x1
            C x2 
            then the program will read a file where that file contains a text to be encrypted to ascii code..it will also be decrypted by doing the process reversely..
            My Blog: http://jhommark.blogspot.com
            My Facebook: http://www.facebook.com/jhommark
            My Official Site: http://www.undergroundweb.tk
            My Community Site: http://undergroundwap.xtreemhost.com

            Comment


              #7
              Please try to look at my codes and read every comments i put there..I only type these with my phone..Dunno if it's running, but my only point is to further explain you my problem and hope you could help me with it..Especially those it graduates and higher level to me..I'm only first year college student..We're on visual c++..This is the link to my codes, please download and post the solved one..Thank you..
              Last edited by kiLLeR-eyEd_14; 13.03.10, 11:17.
              My Blog: http://jhommark.blogspot.com
              My Facebook: http://www.facebook.com/jhommark
              My Official Site: http://www.undergroundweb.tk
              My Community Site: http://undergroundwap.xtreemhost.com

              Comment

              Working...
              X