Thursday, March 26, 2009

Calculate meta length!

How to calculate meta length in characters:

private static string GetMetaLengthBin(int nDataLength)
{
//Steps to calculate the meta length in characters
//STEP 1: Get the div part. Divide data length by 256
//STEP 2: Get the Modulus part. Take modulus of Data length by 256
//STEP 3: Convert into characters, concat and return. 

string strLengthInChars = string.Empty;
int nPartDiv = nDataLength / 256;
int nPartMod = nDataLength % 256;
char chDiv = Convert.ToChar(nPartDiv);
char chMod = Convert.ToChar(nPartMod);

strLengthInChars = chDiv.ToString() + chMod.ToString();

return strLengthInChars;
}

Tuesday, March 24, 2009

HSM Simulator

Released on Mar 8th, an excellent resource was forwarded by a friend, is a software based open implementation of HSM, Hardware security module. The HSM simulator is a library that provides almost all of the functionalities offered by Thales HSM.

Almost all means, that several commands were not implemented fully (like the PA-Load Formatting Data whose sole implementation task is to respond to the host application) or not at all (like commands that have to do with the IBM verification method).

Thales Simulator Library

Related Posts

Popular Posts