示例#1
0
 public static bool Init(byte[] key)
 {
     try
     {
         var prmts = new KeyParameter(key);
         enc.Init(true, prmts);
         dec.Init(false, prmts);
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
示例#2
0
 /**
 * initialise a RC4 cipher.
 *
 * @param forEncryption whether or not we are for encryption.
 * @param parameters the parameters required to set up the cipher.
 *
 */
 public void Init(bool forEncryption, KeyParameter parameters)
 {
     workingKey = parameters.GetKey();
         SetKey(workingKey);
         return;
 }