    001    package org.bouncycastle.crypto;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import java.security.SecureRandom;
    006
    007    @SideOnly(Side.CLIENT)
    008    public class CipherKeyGenerator
    009    {
    010        protected SecureRandom random;
    011        protected int strength;
    012
    013        public void init(KeyGenerationParameters par1)
    014        {
    015            this.random = par1.getRandom();
    016            this.strength = (par1.getStrength() + 7) / 8;
    017        }
    018
    019        public byte[] generateKey()
    020        {
    021            byte[] var1 = new byte[this.strength];
    022            this.random.nextBytes(var1);
    023            return var1;
    024        }
    025    }