Org.BouncyCastle.Crypto.Engines.BlowfishEngine.Init C# (CSharp) Method

Init() public method

public Init ( bool forEncryption, byte key ) : void
forEncryption bool
key byte
return void
        public void Init(
            bool forEncryption,
            byte[] key)
        {
            this.encrypting = forEncryption;
            this.workingKey = key;
            SetKey(this.workingKey);
        }

Usage Example

        const string KEY = "wHcnqpHNN"; // "STINGMIMI";

        public static string Decode4odToken(string token)
        {
            byte[] encryptedBytes = Convert.FromBase64String(token);
            BlowfishEngine bf = new BlowfishEngine();
            bf.Init(false, new KeyParameter(Encoding.ASCII.GetBytes(KEY)));
            byte[] decryptedBytes = decrypt(encryptedBytes, bf);
            return Encoding.ASCII.GetString(decryptedBytes);
        }
All Usage Examples Of Org.BouncyCastle.Crypto.Engines.BlowfishEngine::Init