Game Development Community

Larger Encryptions

by Scott Doerrfeld · in General Discussion · 06/08/2007 (1:37 pm) · 3 replies

I've been looking at different ways to implement encryptions in torque. This resource provides a method which I would like to use, the problem is that it only shows the method for implementing an 8-bit encryption which provides an easily breakable encryption. I was wondering if anyone knows how to increase the size of this encryption to 32-bits or higher. The resource is:

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7253

It looks like I am running into trouble in this section:

XORStream::encrypt( const U32 size, const void *in, void *out )
{
for( int i = 0; i < size; i++ )
((U8 *)out)[i] = ((U8 *)in)[i] ^ mKey;


Is there a good way to alter this to support a higher bit-encryption?

Thanks

#1
06/09/2007 (4:12 am)
Hi Scott,

You may find this useful:

efgh.com/software/rijndael.htm

On that page is C/C++ source code for an implementation of the Rijndael Advanced Encryption Standard , which uses 256-bit keys.

Cheers,
Aaron.
#2
06/10/2007 (12:27 am)
What do you mean trouble? Have you tried just changing the variables to 32 bit?

for( U32 i = 0; i < size; i++ )
((U32 *)out)[i] = ((U32 *)in)[i] ^ mKey;
#3
06/10/2007 (1:13 am)
Increasing it to 32 bit won't help you much, if anything. Try the TEA algo.