# 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: ÕÕÕÔÔÔÓÓÓððð...ÑÑÑàèäÐíÐ\$øÐ&quot; ...If you can't find ...

1. ## 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.

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

3. Just post the source code already.

http://www.interhack.net/people/cmcu...e-oil-faq.html
Secret Algorithm

4. 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. 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. I can see my comment from your last thread fell on deaf ears.

7. 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. This is a different type of decryption.

It has more protection then the last one.

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. 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. Originally Posted by Salem
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. 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. Wrong, This will only changes letters...Try decrypting with the XOR crypt algorithm. you'll see. + Easily to decrypt.

13. 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. 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. Encryption code:

Code:
```
{
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 Last