Power Encryption 2

This is a discussion on Power Encryption 2 within the C++ Programming forums, part of the General Programming Boards category; Hello, i have made a second encryption program. Now, try to decrypt this text. Code: ÕÕÕÔÔÔÓÓÓððð...ÑÑÑàèäÐíÐ$øÐ" ...If you can't find ...

  1. #1
    kevinawad
    Guest

    Power Encryption 2

    Hello, i have made a second encryption program. Now, try to decrypt this text.


    Code:
    ÕÕÕÔÔÔÓÓÓððð...ÑÑÑàèäÐíÐ$øÐ"
    ...If you can't find it in a bit. i'll post the source code.
    Last edited by kevinawad; 10-12-2008 at 11:05 PM.

  2. #2
    kevinawad
    Guest
    Anyone trying to find it? if yes, write "Me"

  3. #3
    and the hat of mystery Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    31,336
    Just post the source code already.

    http://www.interhack.net/people/cmcu...e-oil-faq.html
    Secret Algorithm
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    kevinawad
    Guest
    To decrypt the string, here's the function.


    Code:
     
    void Decrypt(std::string& thestring)
    {
    std::string finalstring;
    std::string thestring2 = thestring;
     
    for(int i = thestring.length() - 22; i < thestring.length(); i++)
    {
    thestring[i] = '\0';
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] = thestring2[thestring.length() - i - 1];
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] -= 0x020;
    }
    for(int i = thestring.length() - 20; i < thestring.length(); i++)
    {
    thestring[i] = '\0';
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] -= 1963785463219856;
    }
     
    for(int i = 0; i < thestring.length() - 20; i++)
    {
    finalstring += thestring[i];
     
    }
    thestring = finalstring;
     
    }

  5. #5
    kevinawad
    Guest
    Full decryption source code.


    Code:
    
    #include<iostream>
    #include<fstream>
    #include<string>
    using namespace std;
    void Decrypt(std::string& thestring)
    {
    std::string finalstring;
    std::string thestring2 = thestring;
     
    for(int i = thestring.length() - 22; i < thestring.length(); i++)
    {
    thestring[i] = '\0';
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] = thestring2[thestring.length() - i - 1];
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] -= 0x020;
    }
    for(int i = thestring.length() - 20; i < thestring.length(); i++)
    {
    thestring[i] = '\0';
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] -= 1963785463219856;
    }
     
    for(int i = 0; i < thestring.length() - 20; i++)
    {
    finalstring += thestring[i];
     
    }
    thestring = finalstring;
     
    }
    int main()
    {
    string lol;
    ifstream file;
    file.open("file.txt");
     
    file >> lol;
     
    Decrypt(lol);
    cout <<lol;
     
     
    }
    Make a file, name it file.txt in the same directory as the .exe decryptor. Put the encrypted text in it. And open the program.

  6. #6
    and the hat of mystery Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    31,336
    I can see my comment from your last thread fell on deaf ears.
    YOUR INDENTATION SUCKS.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Registered User
    Join Date
    Nov 2005
    Posts
    683
    You do realize that doesn't work right?

    The string subscript goes out of range several times.
    also
    Code:
    thestring[i] -= 1963785463219856;
    is invalid.

    a char is 0-255.
    So that ridiculously long number you have there is truncated down to 196.

  8. #8
    kevinawad
    Guest
    This is a different type of decryption.

    It has more protection then the last one.

    First...it adds this: !!!~~~@@@###$$$%%%^^

    Second it changes letters place.

    3rd add some random space and codes into the string

    4th add a simple encryption with numbers.

    This has 3x more protection.



  9. #9
    kevinawad
    Guest
    By the way, it doesn't go out of range.

    Put this in a file.txt

    Code:
     
    ÕÕÕÔÔÔÓÓÓððð...ÑÑÑàèäÐíÐ$øÐ"
    Then, try the new code a bit above this post.

  10. #10
    kevinawad
    Guest
    Quote Originally Posted by Salem View Post
    YOUR INDENTATION SUCKS.
    It's not my fault, it's the forum's text editor fault...

    Im writing all my codes perfectly. The forum make my codes all messed up.

    Blame the forum editor.

  11. #11
    Registered User
    Join Date
    Nov 2005
    Posts
    683
    The same thing you are doing could be accomplished with a xor crypt
    Code:
    void Crypt(std::string& str)
    {
      std::string key = "1234567890";
      int keypos = 0;
      for ( int i = 0; i != str.length()-1; ++i )
      { 
         if ( keypos == key.length() )
           keypos = 0;
        else
           ++keypos;
         str.at(i) ^= key.at(keypos);
      }
    }

  12. #12
    kevinawad
    Guest
    Wrong, This will only changes letters...Try decrypting with the XOR crypt algorithm. you'll see. + Easily to decrypt.

  13. #13
    Registered User
    Join Date
    Nov 2005
    Posts
    683
    I am not saying that my code will decrypt your message. I am saying my code will accomplish pretty much the same task, in about 1/100 the time.
    Convenient thing about xor crypting is that it keeps the average guy out of your stuff, or if you get fancy with it, one of the more powerful cryptography types.

  14. #14
    kevinawad
    Guest
    But, it will be easy to decrypt...It won't actually accomplish the same thing...what if some hackers find about this encryption...it will be 100x more easy to decrypt...

    It takes less time yes, but less protection.

  15. #15
    kevinawad
    Guest
    Encryption code:

    Code:
     
    void CAwad::Encrypt(std::string& thestring)
    {
    thestring += "!!!~~~@@@###$$$%%%^^";
    std::string thestring2 = thestring;
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] = thestring2[thestring.length() - i - 1];
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] += 0x020;
    }
    for(int i = 0; i < thestring.length(); i++)
    {
    thestring[i] += 196;
    }
    }

Page 1 of 3 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 12:48 PM
  2. Problem With My Box
    By HaVoX in forum Tech Board
    Replies: 9
    Last Post: 10-15-2005, 07:38 AM
  3. No Power, but power being supplied.
    By jrahhali in forum Tech Board
    Replies: 6
    Last Post: 08-11-2005, 02:50 AM
  4. Power supplies and demanding processors
    By Liger86 in forum Tech Board
    Replies: 12
    Last Post: 03-17-2005, 10:56 AM

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