How to make with C language
for Feistel Cipher coding...
plis help me !!!

im new bie

http://refact.blogspot.com/2007/02/effective-implementation-of-cast-128.html

public byte[] EncryptMyData(byte[] plainData, out byte[] encryptionKey)
{
    encryptionKey = Guid.NewGuid().ToByteArray();
    int[] scheduledKey = AcedCast5.ScheduleKey(encryptionKey);
    long iv = AcedCast5.GetOrdinaryIV(scheduledKey);
    byte[] result = (byte[])plainData.Clone();
    AcedCast5.EncryptCBC(scheduledKey, result, 0, result.Length, iv);
    AcedCast5.ClearKey(scheduledKey);
    return result;
}

public byte[] DecryptMyData(byte[] encryptedData, byte[] decryptionKey)
{
    int[] scheduledKey = AcedCast5.ScheduleKey(decryptionKey);
    long iv = AcedCast5.GetOrdinaryIV(scheduledKey);
    byte[] result = (byte[])encryptedData.Clone();
    AcedCast5.DecryptCBC(scheduledKey, result, 0, result.Length, iv);
    AcedCast5.ClearKey(scheduledKey);
    return result;
}

I expected you forgot # in your question and you mean C# not C language.

wa thanks for your help,
my name is Randy
im IT student at President University, in indonesia....
thanks a lot....
i will tray, what compiler using for c# ???

public byte[]
EncryptMyData (byte[] plainData, out byte[] encryptionKey)<-- what the mean of this???

{
encryptionKey = Guid.NewGuid().ToByteArray();

int[] scheduledKey = AcedCast5.ScheduleKey(encryptionKey);

long iv = AcedCast5.GetOrdinaryIV(scheduledKey);

byte[] result = (byte[])plainData.Clone();

AcedCast5.EncryptCBC(scheduledKey, result, 0, result.Length, iv);

AcedCast5.ClearKey(scheduledKey);

return result;

}


12.
public byte[] DecryptMyData(byte[] encryptedData, byte[] decryptionKey)
13.
{
14.
int[] scheduledKey = AcedCast5.ScheduleKey(decryptionKey);
15.
long iv = AcedCast5.GetOrdinaryIV(scheduledKey);
16.
byte[] result = (byte[])encryptedData.Clone();
17.
AcedCast5.DecryptCBC(scheduledKey, result, 0, result.Length, iv);
18.
AcedCast5.ClearKey(scheduledKey);
19.
return result;
20.
}

EncryptMyData (byte[] plainData, out byte[] encryptionKey)<-- what the mean of this???

It sends two arrays of byte datatype one is plain text (to be encrypted and the second is the key the text encrypted by)
You're welcome please mark this thread as solved.
Any question regards the code please reply on the blog there.

im not familiar with this languange because this is the first week i am take this subject....

why u said im in wrong forum????

> im not familiar with this languange because this is the first week i am take this subject....
Jeez, how many more times am I gonna see "Feistel Cipher" cross-posting mayhem!?

You're on the wrong course, if this is week 1, and you've been asked to write a cipher from scratch.

This article has been dead for over six months. Start a new discussion instead.