• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[C++]Simple encoding routine

Newbie Spellweaver
Joined
Sep 12, 2012
Messages
21
Reaction score
1
Basically, it's a simple encoding function (I think).
Here's the code:

Code:
int* EncryptKey(int key){
int res = key * 256;
int prime = abs(1024);
int table[256]; //set up our table
table[0] = 128;
table[256];
int mix = 124;
int remix = 234;
/**
Mix up table
*/
int* cipher = std::rotate(table, table+mix, table+remix);
cout << cipher;
return cipher;
}

Usage:
Code:
#include <iostream>
#include <math.>
#include <time.h>
using namespace std;
int main(){
EncryptKey(<number>);
return 0;
}

You can use:
Code:
cin.get();

to wait for the user to hit enter before exiting.
Screen:

SOjmS - [C++]Simple encoding routine - RaGEZONE Forums

The top number is a random key generated by a function I wrote, it has nothing to do with this. The bottom string is your encoded string.
Have fun.

~Youmu
 

Attachments

You must be registered for see attachments list
Back
Top