Show DevBest [C++]Encoding function

Status
Not open for further replies.

Adil

DevBest CEO
May 28, 2011
1,278
716
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.png

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.

~Adil
 
Status
Not open for further replies.

Users who are viewing this thread

Top