Can you identify this algorithm? We are attempting to integrate our application in to a third party system. To do this we need to pass encrypted passwords in to this system. I have decompiled the assembly and looking at the code it seems that they are using something similar to XOR encryption (In a production system...) From what I can see from the decompiled code it does something like this:

The pseudo code bellow is wrong. Here is a link to the source code, decompiled , converted to C# and cleaned up a bit: http://pastebin.com/rAcXPvL6

string key = "1234567890123456"
string plainText = "test"
int[] keyData = GetAsciiValuesAsArray(key)
int[] plainData = GetAsciiValuesAsArray(plainText)
int prime = GeneratePrimeNumber()
string cipherText = ""


foreach(plainTextChar in plainData)
{
     int a = prime / 256.0 * 256.0 - prime % 256 / 256.0
     int b = prime % 256
     for(int i = 0; i &lt; 16;i++)
     {
          keyData[i] = keyData[i] ^ GetAsciiValue(plainTextChar);
     }
     plainTextChar = plainTextChar ^ (a ^ b)
     int c = (plainTextChar / 16.0 * 16.0 - (plainTextChar % 16)) / 16.0;
     int d = plainTextChar = % 16
     cipherText = cipherText + ConvertFromAscii(c + 97) + ConvertFromAscii(d + 97)
}


Does this seem familiar to anyone? Hopefully it's a recognized algorithm and not something they have cobbled together themselves.

Thanks,

Joe
First: Analyzing code is off-topic on this site, don't expect much.

To the question: "Never write your own crypto" is a statement, that is all too often disregarded. Without digging deep, it looks like some self-made (and totally insecure) algorithm: The key is not used at all, therefore it is basically a streamcipher (one symbol at a time) with a deterministic keystream.

Recommendation: Do not use this, and don't use their crypto implementations in the future. Not every error is as easy to detect as this one. And in crypto you can do lots of things wrong.