Esempio n. 1
0
        public static BlowfishCipher CreateEks(byte[] key, byte[] salt, int cost)
        {
            Helper.CheckRange("key", key, 1, 72);
            Helper.CheckRange("salt", salt, 16, 16);
            Helper.CheckRange("cost", cost, 4, 31);

            BlowfishCipher fish = new BlowfishCipher();
            fish.ExpandKey(key, salt);
            for (uint i = 1u << cost; i > 0; i --)
            {
                fish.ExpandKey(key, ZeroSalt);
                fish.ExpandKey(salt, ZeroSalt);
            }
            return fish;
        }
Esempio n. 2
0
        public static BlowfishCipher Create(byte[] key)
        {
            Helper.CheckRange("key", key, 4, 56);

            BlowfishCipher fish = new BlowfishCipher();
            fish.ExpandKey(key, ZeroSalt);
            return fish;
        }