|
You last visited: Today at 02:41
Advertisement
[Release] The New Cryptography [Cast-128/Cast-5]
Discussion on [Release] The New Cryptography [Cast-128/Cast-5] within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
07/19/2011, 06:58
|
#16
|
elite*gold: 0
Join Date: Jun 2009
Posts: 372
Received Thanks: 53
|
Quote:
Originally Posted by Mr_PoP
that's not quit correct even if it worked!
|
it works fine for this dont think it matters much since it allow a login which is wat its supose 2 do
|
|
|
07/19/2011, 07:21
|
#17
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by Mr_PoP
that's not quit correct even if it worked!
|
There are many ways of implementing it.
This is the way that I found. ._.
Just because it's different doesn't mean that it isn't correct.
|
|
|
07/19/2011, 12:52
|
#18
|
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
|
Since what patch is this cryptography?
|
|
|
07/19/2011, 12:55
|
#19
|
elite*gold: 20
Join Date: Jan 2006
Posts: 890
Received Thanks: 241
|
Quote:
Originally Posted by Iron~Man
Since what patch is this cryptography?
|
5509
|
|
|
07/19/2011, 15:09
|
#20
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by Fаng
There are many ways of implementing it.
This is the way that I found. ._.
Just because it's different doesn't mean that it isn't correct.
|
it's not correct because you're allocating mroe than cast_st needs
|
|
|
07/19/2011, 15:18
|
#21
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by Mr_PoP
it's not correct because you're allocating mroe than cast_st needs
|
That doesn't have anything to do with the thread I posted.
That's their file's code.
|
|
|
07/19/2011, 16:16
|
#22
|
elite*gold: 0
Join Date: May 2010
Posts: 248
Received Thanks: 36
|
not working changed them all
PHP Code:
using System;
using System.Runtime.InteropServices;
namespace Conquer_Online_Server.Network.Cryptography
{
public class GameCryptography
{
Blowfish _blowfish;
public GameCryptography(byte[] key)
{
_blowfish = new Blowfish(BlowfishAlgorithm.CFB64);
_blowfish.SetKey(key);
}
public void Decrypt(byte[] packet)
{
byte[] buffer = _blowfish.Decrypt(packet);
System.Buffer.BlockCopy(buffer, 0, packet, 0, buffer.Length);
}
public void Encrypt(byte[] packet)
{
byte[] buffer = _blowfish.Encrypt(packet);
System.Buffer.BlockCopy(buffer, 0, packet, 0, buffer.Length);
}
public Blowfish Blowfish
{
get { return _blowfish; }
}
public void SetKey(byte[] k)
{
_blowfish.SetKey(k);
}
public void SetIvs(byte[] i1, byte[] i2)
{
_blowfish.EncryptIV = i1;
_blowfish.DecryptIV = i2;
}
}
public enum BlowfishAlgorithm
{
ECB,
CBC,
CFB64,
OFB64,
};
public class Blowfish : IDisposable
{
[DllImport("libeay32.dll")]
public extern static void CAST_set_key(IntPtr _key, int len, byte[] data);
[DllImport("libeay32.dll")]
public extern static void BF_ecb_encrypt(byte[] in_, byte[] out_, IntPtr schedule, int enc);
[DllImport("libeay32.dll")]
public extern static void BF_cbc_encrypt(byte[] in_, byte[] out_, int length, IntPtr schedule, byte[] ivec, int enc);
[DllImport("libeay32.dll")]
public extern static void CAST_cfb64_encrypt(byte[] in_, byte[] out_, int length, IntPtr schedule, byte[] ivec, ref int num, int enc);
[DllImport("libeay32.dll")]
public extern static void BF_ofb64_encrypt(byte[] in_, byte[] out_, int length, IntPtr schedule, byte[] ivec, out int num);
[StructLayout(LayoutKind.Sequential)]
struct bf_key_st
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)]
public UInt32[] P;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)]
public UInt32[] S;
}
private BlowfishAlgorithm _algorithm;
private IntPtr _key;
private byte[] _encryptIv;
private byte[] _decryptIv;
private int _encryptNum;
private int _decryptNum;
public Blowfish(BlowfishAlgorithm algorithm)
{
_algorithm = algorithm;
_encryptIv = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 };
_decryptIv = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 };
bf_key_st key = new bf_key_st();
key.P = new UInt32[16 + 2];
key.S = new UInt32[4 * 256];
_key = Marshal.AllocHGlobal(key.P.Length * sizeof(UInt32) + key.S.Length * sizeof(UInt32));
Marshal.StructureToPtr(key, _key, false);
_encryptNum = 0;
_decryptNum = 0;
}
public void Dispose()
{
Marshal.FreeHGlobal(_key);
}
public void SetKey(byte[] data)
{
_encryptNum = 0;
_decryptNum = 0;
CAST_set_key(_key, data.Length, data);
}
public byte[] Encrypt(byte[] buffer)
{
byte[] ret = new byte[buffer.Length];
switch (_algorithm)
{
case BlowfishAlgorithm.ECB:
BF_ecb_encrypt(buffer, ret, _key, 1);
break;
case BlowfishAlgorithm.CBC:
BF_cbc_encrypt(buffer, ret, buffer.Length, _key, _encryptIv, 1);
break;
case BlowfishAlgorithm.CFB64:
CAST_cfb64_encrypt(buffer, ret, buffer.Length, _key, _encryptIv, ref _encryptNum, 1);
break;
case BlowfishAlgorithm.OFB64:
BF_ofb64_encrypt(buffer, ret, buffer.Length, _key, _encryptIv, out _encryptNum);
break;
}
return ret;
}
public byte[] Decrypt(byte[] buffer)
{
byte[] ret = new byte[buffer.Length];
switch (_algorithm)
{
case BlowfishAlgorithm.ECB:
BF_ecb_encrypt(buffer, ret, _key, 0);
break;
case BlowfishAlgorithm.CBC:
BF_cbc_encrypt(buffer, ret, buffer.Length, _key, _decryptIv, 0);
break;
case BlowfishAlgorithm.CFB64:
CAST_cfb64_encrypt(buffer, ret, buffer.Length, _key, _decryptIv, ref _decryptNum, 0);
break;
case BlowfishAlgorithm.OFB64:
BF_ofb64_encrypt(buffer, ret, buffer.Length, _key, _decryptIv, out _decryptNum);
break;
}
return ret;
}
public byte[] EncryptIV
{
get { return _encryptIv; }
set { System.Buffer.BlockCopy(value, 0, _encryptIv, 0, 8); }
}
public byte[] DecryptIV
{
get { return _decryptIv; }
set { System.Buffer.BlockCopy(value, 0, _decryptIv, 0, 8); }
}
}
}
|
|
|
07/19/2011, 17:13
|
#23
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
|
If it doesnt work you've done it wrong, im not going to look thru the code you posted.
|
|
|
07/19/2011, 17:21
|
#24
|
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
|
how did u changed why the BF is there yet?
BF_ecb_encryp???? its CAST NOT BF!!
|
|
|
07/19/2011, 18:21
|
#25
|
elite*gold: 0
Join Date: May 2010
Posts: 248
Received Thanks: 36
|
Quote:
Originally Posted by _DreadNought_
If it doesnt work you've done it wrong, im not going to look thru the code you posted.
|
nothing with your business never asked you to look out that thread got thread owner he can answer whats wrong i did and yes thanks leo 
|
|
|
07/19/2011, 21:06
|
#26
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
|
Quote:
Originally Posted by CØĐ£Ř||Mã©hÍñє
nothing with your business never asked you to look out that thread got thread owner he can answer whats wrong i did and yes thanks leo  
|
Not converted this to unsafe(quicker processing) or cleaned it, Just a quick sketch on actually logging in with the new algorithm.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConquerSource.Core;
using System.Runtime.InteropServices;
namespace ConquerSource.Game.Cryptography
{
public class GameCrypto
{
readonly CAST5 _Cast;
public GameCrypto(byte[] key)
{
_Cast = new CAST5(CastAlgorithm.CFB64);
_Cast.SetKey(key);
}
public void Decrypt(byte[] packet)
{
byte[] buffer = _Cast.Decrypt(packet);
Buffer.BlockCopy(buffer, 0, packet, 0, buffer.Length);
}
public void Encrypt(byte[] packet)
{
byte[] buffer = _Cast.Encrypt(packet);
Buffer.BlockCopy(buffer, 0, packet, 0, buffer.Length);
}
public CAST5 Blowfish
{
get { return _Cast; }
}
public void SetKey(byte[] k)
{
_Cast.SetKey(k);
}
public void SetIvs(byte[] i1, byte[] i2)
{
_Cast.EncryptIV = i1;
_Cast.DecryptIV = i2;
}
}
public enum CastAlgorithm
{
ECB,
CBC,
CFB64,
OFB64,
};
public class CAST5
{
[StructLayout(LayoutKind.Sequential)]
struct CAST_key_st
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)]
public UInt32[] P;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)]
public UInt32[] S;
}
private CastAlgorithm _Type;
private IntPtr Key;
private byte[] _EncryptIV;
private byte[] _DecryptIV;
private int _EncryptKey;
private int _DecryptKey;
public CAST5(CastAlgorithm AlgorithmType)
{
_Type = AlgorithmType;
_EncryptIV = new byte[8];
_DecryptIV = new byte[8];
CAST_key_st key = new CAST_key_st();
key.P = new UInt32[16 + 2];
key.S = new UInt32[4 * 256];
Key = Marshal.AllocHGlobal(key.P.Length * sizeof(UInt32) + key.S.Length * sizeof(UInt32));
Marshal.StructureToPtr(key, Key, false);
}
public void SetKey(byte[] data)
{
Kernel.CAST_set_key(Key, data.Length, data);
_DecryptKey = 0;
_EncryptKey = 0;
}
public byte[] Encrypt(byte[] buffer)
{
byte[] ret = new byte[buffer.Length];
switch (_Type)
{
case CastAlgorithm.CFB64:
Kernel.CAST_cfb64_encrypt(buffer, ret, buffer.Length, Key, _EncryptIV, out _EncryptKey, 1);
break;
}
return ret;
}
public byte[] Decrypt(byte[] buffer)
{
byte[] ret = new byte[buffer.Length];
switch (_Type)
{
case CastAlgorithm.CFB64:
Kernel.CAST_cfb64_encrypt(buffer, ret, buffer.Length, Key, _DecryptIV, out _DecryptKey, 0);
break;
}
return ret;
}
public byte[] EncryptIV
{
get { return _EncryptIV; }
set { Buffer.BlockCopy(value, 0, _EncryptIV, 0, 8); }
}
public byte[] DecryptIV
{
get { return _DecryptIV; }
set { Buffer.BlockCopy(value, 0, _DecryptIV, 0, 8); }
}
}
}
Code:
#region Cast5/Cast128
[DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
public extern static void CAST_set_key(IntPtr _key, int len, byte[] data);
[DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
public extern static void CAST_cfb64_encrypt(IntPtr _key, int len, byte[] data);
[DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
public extern static void CAST_cfb64_encrypt(byte[] in_, byte[] out_, int length, IntPtr schedule, byte[] ivec, out int num, int enc);
#endregion
Suck it, noob.
|
|
|
07/19/2011, 22:36
|
#27
|
elite*gold: 0
Join Date: Mar 2009
Posts: 228
Received Thanks: 47
|
Is there any help ?
|
|
|
07/19/2011, 22:41
|
#28
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Quote:
Originally Posted by Y u k i
Lowfyr gone, John came or wtf ever his name is, Ima quote something he posted at his introduction:
Now this all happened to fang releasing something.
if that wasnt an attempt of censoring, idk.
|
There has been no official word back on what the final decision was on the subject but all the threads magically re-appeared so I'd just say leave the whole topic dead unless they try to implement rules like this in the future.
No reason to bring up un-needed drama into an already rather dramatic forum/section
|
|
|
07/19/2011, 22:46
|
#29
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
I'm not helping anyone with this... none of you should be. If they can't follow such an easy guide- they don't deserve the help. They're obviously not trying.
|
|
|
07/19/2011, 22:55
|
#30
|
elite*gold: 0
Join Date: Mar 2009
Posts: 228
Received Thanks: 47
|
Quote:
Originally Posted by Fаng
I'm not helping anyone with this... none of you should be. If they can't follow such an easy guide- they don't deserve the help. They're obviously not trying.
|
thanks any way fang
|
|
|
 |
|
Similar Threads
|
Frage zu Cast-Quest - Cast Rüssi Schurkin 777
11/17/2012 - Last Chaos Private Server - 17 Replies
Huhu wollte mal wissen wo man die Quest für die Casting sachen annimmt und bei welchen Mops man die droppt ...
mit oder ohne rolle mit oder ohne samen? xD
gibtn thanks
danke
gute nacht
|
cast titan schwert und cast dualls
06/20/2011 - Last Chaos - 16 Replies
ich habe da mal ne frage es gibt viele die sagen das man von compla kisten titan cast schwert und ritter cast dualls droppen kann was stimmt jetz gibt es die oder nicht ??
|
[Release]Cooldown/cast/Backward shoot hacks.
06/08/2011 - General Gaming Discussion - 78 Replies
:):):):):):):):):):):):):)
/RUS/
Итак, решился я выложит& #1100; в паблик кое-что. Для начала нам понадоб& #1080;тся програм& #1084;а CheatEngine(далее СЕ), скачать СЕ можно http://rghost.ru/71027.Для начала, запуска& #1077;м реквием, логиним& #1089;я, заходим в игру.Сво рачивае& #1084; (альт+таб ;) и заходим в СЕ.В СЕ выбирае& #1084; процесс Requiem,в строке Value type выбирае& #1084; Text, далее в строку вводим названи& #1077; скилла, наприме& #1088; Молния,ж мем поиск.СЕ находит много значени& #1081;,
теперь нам нужно найти группу скиллов: ...
|
*##WTB CAST SCHMUCK ODER CAST RüSTUNG Knight 85!Eternia##*
12/26/2010 - Last Chaos Trading - 5 Replies
Huhu LC Zocker..
Ich bin auf der Suche nach Cast Schmuck(Skill Cooldown) oder Ritter Rüstungsteile die Cast besitzen. MUSS EVA Siegeln haben! 85-87er! oder 105er oder 115er aber b6e ist pflicht^^
Natürlich auf Eternia Games..
Geplusst oder ungeplusst ist unwichtig. Hauptsache Cast b6e!
|
[Release] Quick Cast Plugin
02/24/2007 - Flyff - 0 Replies
Description: This is a simple plugin for FlyFF Termination (v1.55) that buffs a targeted player. This plugin does not speed up casting. It is just a time saver for assists, as it will cast all their available buffs on a player or themselves with one command. This plugin makes use of the new functionality provided in the version two SDK.
(i reupload this update for the SDK on rapidshare bellow)
Instructions: Install the plugin (you must have FlyFF Termination (v1.55) already installed). Once...
|
All times are GMT +1. The time now is 02:42.
|
|