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; } }
/** * 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; }