May be it will useful for some registration system, which work without Steam ID validation
It actually decode string in the RC4 way using custom key
Quote:
What is RC4?
RC4 was created by Ron Rivest of RSA Security in 1987. It is one of the most widely-used software stream cipher and is used in popular protocols such as Secure Sockets Layer (SSL) (to protect Internet traffic) and WEP (to secure wireless networks). RC4 is used in many commercial software packages such as Lotus Notes and Oracle Secure SQL.
There are two parts in RC4 algorithm, a 'key scheduling algorithm' (KSA) which turns a random key (typically between 40 and 256 bits) into an initial permutation of S-box of N(power of 2). The other part is 'pseudorandom number generator(' PRNG), PRNG uses the permutation to generate a pseudo-random number sequence which is XORed with the plaintext to give the cipher text.
RC4 is a fast cipher algorithm and about 10 times faster than DES(Data Encryption Standard).
This wrapping class CRC4 is a handy version for using by avoiding string terminator ¡®\0¡¯ in the middle of the encoded text data. It is annoying and bug-hidden if you want to handle the encoded text data as a string without knowing that the '\0' character could truncate your cipher text to be incomplete.
/**
* vim: set ts=4 :
* ============================================= ================================
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* ============================================= ================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _decoder_included
#endinput
#endif
#define _decoder_included
/**
* @brief Decrypt string.
*
* @param encrypt The string for decrypting.
* @param key The special 8-bit key, which was used for encrypt.
* @param string The distanation string.
* @param lenght The distanation string lenght.
*/
native void StrDecrypt(char[] encrypt, char[] key, char[] string, int lenght);
/**
* @brief Encrypt string.
*
* @param string The string for encrypting.
* @param key The special 8-bit key.
* @param encrypt The distanation string.
* @param lenght The distanation string lenght.
*/
native void StrEncrypt(char[] string, char[] key, char[] encrypt, int lenght);