Name: Anonymous 2016-05-27 7:25
What does this number stands for? I've stumbled upon it during reverse engineering a simple encryption scheme.
How is encryption related to "random" numbersare you seriously asking?
are you seriously asking?Yes. I have never encountered any encryption algorithm before, so I wonder why "random" numbers are involved. And the constant 0x41C64E6D is not random if anything, because every second random generator use it. Guess it came from Knuth's book or something.
how does your crypto work btw? is it a stream cipher or a block cipher? is it similar to any popular algorithms?It works like following (decrypt_init uses random number fill in the table with 1234567890u being the both the seed and the password)
uint32_t GDecryptPRNG_State;
uint32_t GDecryptMap[256];
uint32_t decrypt_sub(uint32_t *table) {
uint32_t a, b, c;
a = table[0];
table[a] = GDecryptMap[a];
b = table[1];
table[1] = GDecryptMap[b];
c = table[b + 2] ^ table[a + 2];
table[a + 2] = c;
return c;
}
void decrypt_init(uint32_t *table, uint32_t seed) {
int i;
uint32_t *p;
int count;
uint64_t t;
unsigned int a;
uint32_t k;
uint32_t *q;
int b;
for (i = 0; i < 256; i++) GDecryptMap[i] = i+1;
GDecryptPRNG_State = seed;
table[0] = 0;
table[1] = 103;
p = table + 251;
count = 250;
do
{
t = 0x41C64E6DULL * GDecryptPRNG_State;
HIDWORD(t) <<= 16;
t += 0xFFFF00003039ULL;
GDecryptPRNG_State = t;
*p = HIDWORD(t) & 0xFFFF0000 | ((uint32_t)t >> 16);
--p;
--count;
} while ( count );
a = 0xFFFFFFFF;
k = 0x80000000;
q = table + 5;
do {
b = *q;
q += 7;
*(q - 7) = k | a & b;
k >>= 1;
a >>= 1;
} while ( k );
}
int decrypt(uint32_t *data, int datasize) {
signed int result;
uint32_t *p;
uint32_t a, b, c, d, e;
uint32_t table[256];
memset(table, 0, 256*sizeof(uint32_t));
decrypt_init(table, 1234567890u);
if (datasize <= 12) return 0;
p = data + 1;
decrypt_init(table, *data);
e = datasize - 4;
if ( (datasize - 4) / 4 > 0 )
{
a = e / 4;
do
{
b = decrypt_sub(table);
c = *p;
++p;
--a;
*(p - 1) = b ^ c;
}
while ( a );
}
d = e % 4;
if ( d > 0 )
{
do
{
--d;
*(uint8_t*)p ^= decrypt_sub(table);
} while ( d );
}
return 1;
}
do
{
DWord = *PData;
if ( Count & 1 )
chksum += DWord;
else
chksum ^= DWord;
++Count;
++PData;
}
while ( Count < NumDWord );
Position-dependent checksums[edit]
The simple checksums described above fail to detect some common errors which affect many bits at once, such as changing the order of data words, or inserting or deleting words with all bits set to zero.
DWordThat was WINDOWS QUALITY!
I'm currently working on my own game for Steam: http://steamcommunity.com/sharedfiles/filedetails/?id=514233906Oh cool, I didn't know that. I'll buy a copy.
Very Secure Curve™
a = 1
n = 5846006549323611672814741753598448348329118574063
Polynomial Basis:
G x = 2 fe13c053 7bbc11ac aa07d793 de4e6d5e 5c94eee8
G y = 2 89070fb0 5d38ff58 321f2e80 0536d538 ccdaa3d9
Normal Basis:
G x = 0 5679b353 caa46825 fea2d371 3ba450da 0c2a4541
G y = 2 35b7c671 00506899 06bac3d9 dec76a83 5591edb2