Class CryptoStreamFactoryImpl

  • All Implemented Interfaces:
    CryptoStreamFactory

    public class CryptoStreamFactoryImpl
    extends CryptoStreamFactoryTemplate
    implements CryptoStreamFactory
    Concrete factory for creating encrypting/decrypting streams. The implementation uses the JCA (Java Crypto Extension) supplied by SUN (using SunJCE 1.42). The implementation uses as PBEWithMD5AndDES for encryption which should be sufficent for most applications. The implementation also supplies a default password in the case that the programmer don't want to have additional hassles. It is easy to reengineer the password being used but much better than a hard-coded password in the application. The code uses parts from Markus Hahn's Blowfish library found at http://blowfishj.sourceforge.net/
    Author:
    Siegfried Goeschl , Markus Hahn
    • Field Detail

      • salt

        protected final byte[] salt
        the salt for the PBE algorithm
      • count

        protected int count
        the count paramter for the PBE algorithm
      • providerName

        protected String providerName
        the name of the JCE provider
      • algorithm

        protected String algorithm
        the algorithm to use
      • PROVIDERNAME

        protected static final String PROVIDERNAME
        The JCE provider name known to work. If the value is set to null an appropriate provider will be used.
    • Constructor Detail

      • CryptoStreamFactoryImpl

        public CryptoStreamFactoryImpl()
        Constructor
      • CryptoStreamFactoryImpl

        public CryptoStreamFactoryImpl​(byte[] salt,
                                       int count)
        Constructor
        Parameters:
        salt - the salt for the PBE algorithm
        count - the iteration for PBEParameterSpec