Java 类org.bouncycastle.crypto.engines.IESEngine 实例源码

项目:ipack    文件:IESUtil.java   
public static IESParameterSpec guessParameterSpec(IESEngine engine)
{
    if (engine.getCipher() == null)
    {
        return new IESParameterSpec(null, null, 128);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("DES") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC2") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-32") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-64"))
    {
        return new IESParameterSpec(null, null, 64, 64);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("SKIPJACK"))
    {
        return new IESParameterSpec(null, null, 80, 80);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("GOST28147"))
    {
        return new IESParameterSpec(null, null, 256, 256);
    }

    return new IESParameterSpec(null, null, 128, 128);
}
项目:secrete    文件:ECIES.java   
public static byte[] decryptMessage(PrivateKey key, ECIESMessage message) throws ECIESException {

        try {

            // check key algorithm
            if (!key.getAlgorithm().equals(ASYMMETRIC_ALGORITHM))
                throw new ECIESException("Wrong key algorithm");

            // IES engine
            IESEngine ies = getIESEngine();

            // initialize engine
            Curve25519DecryptionParameter ep = new Curve25519DecryptionParameter(key.getEncoded(), message.getR());
            ParametersWithIV p = new ParametersWithIV(new IESWithCipherParameters(message.getSh1(), message.getSh2(), MAC_KEY_SIZE_BITS, AES_KEY_SIZE_BITS), message.getIv());
            ies.init(false, null, ep, p);

            // decrypt and return data
            return ies.processBlock(message.getCd(), 0, message.getCd().length);

        } catch (InvalidCipherTextException ex) {

            throw new ECIESException("Message corrupted or wrong key", ex);
        }
    }
项目:CryptMeme    文件:IESUtil.java   
public static IESParameterSpec guessParameterSpec(IESEngine engine)
{
    if (engine.getCipher() == null)
    {
        return new IESParameterSpec(null, null, 128);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("DES") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC2") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-32") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-64"))
    {
        return new IESParameterSpec(null, null, 64, 64);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("SKIPJACK"))
    {
        return new IESParameterSpec(null, null, 80, 80);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("GOST28147"))
    {
        return new IESParameterSpec(null, null, 256, 256);
    }

    return new IESParameterSpec(null, null, 128, 128);
}
项目:irma_future_id    文件:IESUtil.java   
public static IESParameterSpec guessParameterSpec(IESEngine engine)
{
    if (engine.getCipher() == null)
    {
        return new IESParameterSpec(null, null, 128);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("DES") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC2") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-32") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-64"))
    {
        return new IESParameterSpec(null, null, 64, 64);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("SKIPJACK"))
    {
        return new IESParameterSpec(null, null, 80, 80);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("GOST28147"))
    {
        return new IESParameterSpec(null, null, 256, 256);
    }

    return new IESParameterSpec(null, null, 128, 128);
}
项目:bc-java    文件:IESUtil.java   
public static IESParameterSpec guessParameterSpec(IESEngine engine)
{
    if (engine.getCipher() == null)
    {
        return new IESParameterSpec(null, null, 128);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("DES") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC2") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-32") ||
            engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("RC5-64"))
    {
        return new IESParameterSpec(null, null, 64, 64);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("SKIPJACK"))
    {
        return new IESParameterSpec(null, null, 80, 80);
    }
    else if (engine.getCipher().getUnderlyingCipher().getAlgorithmName().equals("GOST28147"))
    {
        return new IESParameterSpec(null, null, 256, 256);
    }

    return new IESParameterSpec(null, null, 128, 128);
}
项目:ipack    文件:IESCipher.java   
public IESwithDESede()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:ipack    文件:IESCipher.java   
public IESwithAES()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:ipack    文件:IESCipher.java   
public ECIESwithDESede()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:ipack    文件:IESCipher.java   
public ECIESwithAES()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:ipack    文件:CipherSpi.java   
public IES()
{
    super(new IESEngine(
           new DHBasicAgreement(),
           new KDF2BytesGenerator(new SHA1Digest()),
           new HMac(new SHA1Digest())));
}
项目:Direct-File-Downloader    文件:JCEIESCipher.java   
public ECIES()
{
    super(new IESEngine(
           new ECDHBasicAgreement(),
           new KDF2BytesGenerator(new SHA1Digest()),
           new HMac(new SHA1Digest())));
}
项目:Aki-SSL    文件:IESCipher.java   
public IESwithDESede()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:Aki-SSL    文件:IESCipher.java   
public IESwithAES()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:Aki-SSL    文件:IESCipher.java   
public ECIESwithCipher(BlockCipher cipher)
{
    super(new IESEngine(new ECDHBasicAgreement(),
                    new KDF2BytesGenerator(new SHA1Digest()),
                    new HMac(new SHA1Digest()),
                    new PaddedBufferedBlockCipher(cipher)));
}
项目:Aki-SSL    文件:IESCipher.java   
public ECIESwithCipher(BlockCipher cipher, int ivLength)
{
    super(new IESEngine(new ECDHBasicAgreement(),
                    new KDF2BytesGenerator(new SHA1Digest()),
                    new HMac(new SHA1Digest()),
                    new PaddedBufferedBlockCipher(cipher)), ivLength);
}
项目:AcademicTorrents-Downloader    文件:JCEIESCipher.java   
public ECIES()
{
    super(new IESEngine(
           new ECDHBasicAgreement(),
           new KDF2BytesGenerator(new SHA1Digest()),
           new HMac(new SHA1Digest())));
}
项目:CryptMeme    文件:IESCipher.java   
public IESwithDESede()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:CryptMeme    文件:IESCipher.java   
public IESwithAES()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:CryptMeme    文件:IESCipher.java   
public ECIESwithDESede()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:CryptMeme    文件:IESCipher.java   
public ECIESwithAES()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:CryptMeme    文件:CipherSpi.java   
public IES()
{
    super(new IESEngine(
           new DHBasicAgreement(),
           new KDF2BytesGenerator(new SHA1Digest()),
           new HMac(new SHA1Digest())));
}
项目:irma_future_id    文件:IESCipher.java   
public IESwithDESede()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:irma_future_id    文件:IESCipher.java   
public IESwithAES()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:irma_future_id    文件:IESCipher.java   
public ECIESwithDESede()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:irma_future_id    文件:IESCipher.java   
public ECIESwithAES()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:irma_future_id    文件:CipherSpi.java   
public IES()
{
    super(new IESEngine(
           new DHBasicAgreement(),
           new KDF2BytesGenerator(new SHA1Digest()),
           new HMac(new SHA1Digest())));
}
项目:bc-java    文件:IESCipher.java   
public IESwithDESede()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:bc-java    文件:IESCipher.java   
public IESwithAES()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:bc-java    文件:IESCipher.java   
public ECIESwithDESede()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new DESedeEngine())));
}
项目:bc-java    文件:IESCipher.java   
public ECIESwithAES()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest()),
        new PaddedBufferedBlockCipher(new AESEngine())));
}
项目:bc-java    文件:CipherSpi.java   
public IES()
{
    super(new IESEngine(
           new DHBasicAgreement(),
           new KDF2BytesGenerator(new SHA1Digest()),
           new HMac(new SHA1Digest())));
}
项目:ipack    文件:IESCipher.java   
public IESCipher(IESEngine engine)
{
    this.engine = engine;
}
项目:ipack    文件:IESCipher.java   
public IES()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest())));
}
项目:ipack    文件:IESCipher.java   
public IESCipher(IESEngine engine)
{
    this.engine = engine;
}
项目:ipack    文件:IESCipher.java   
public ECIES()
{
    super(new IESEngine(new ECDHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest())));
}
项目:ipack    文件:CipherSpi.java   
public CipherSpi(
    IESEngine engine)
{
    cipher = engine;
}
项目:Direct-File-Downloader    文件:JCEIESCipher.java   
public JCEIESCipher(
    IESEngine   engine)
{
    cipher = engine;
}
项目:Aki-SSL    文件:IESCipher.java   
public IESCipher(IESEngine engine)
{
    this.engine = engine;
}
项目:Aki-SSL    文件:IESCipher.java   
public IES()
{
    super(new IESEngine(new DHBasicAgreement(),
        new KDF2BytesGenerator(new SHA1Digest()),
        new HMac(new SHA1Digest())));
}
项目:Aki-SSL    文件:IESCipher.java   
public IESCipher(IESEngine engine)
{
    this.engine = engine;
    this.ivLength = 0;
}