AES supported key sizes!

Hi all,
is there any function that specifies key size "secret key" used in AES cryptographic algorithm? if not which key size is supported?
thanks alot.

Hi again,
i ve tried what you have told me but it gave me error ERROR: java.security.InvalidKeyException: Illegal key size or default parameters
here is the code
SecureRandom sprng = SecureRandom.getInstance("SHA1PRNG");
            KeyGenerator key = KeyGenerator.getInstance("AES");
            //key.init(sprng);
            key.init(192,  sprng);
            SecretKey encKey = key.generateKey();
            symmetricKey=encKey;
            Cipher encAES = Cipher.getInstance("AES");
            encAES.init(Cipher.ENCRYPT_MODE, encKey);
            encMsg=encAES.doFinal(message.getBytes());can any body help me plz!

Similar Messages

  • WPA2 AES encryption Key Sizes

    Hi all,
    Just looking at the AES standard, or wiki of it
    http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
    It mentions that AES supports the following (in the notes just at the bottom of the web page)
    Key sizes of 128, 160, 192, 224, and 256 bits are supported by the Rijndael algorithm, but only the 128, 192, and 256-bit key sizes are specified in the AES standard.
    Block sizes of 128, 160, 192, 224, and 256 bits are supported by the Rijndael algorithm, but only the 128-bit block size is specified in the AES standard.
    What does the WLCs use for an AES key size when you enable a WPA2 policy with AES encryption?
    Many thx
    Ken

    128 bits was supported on the autonomous code, so I'm sure the LWAPP solution also uses 128 bits with three possible key lengths 128, 192 and 256 bits.

  • Programmatically determine AES max key size?

    On a JRE that does not have the JCE unlimited strength jurisdiction policy files installed, I find that attempting to create an AES Cipher with a key size larger than 128 bits will throw an InvalidKeyException. Is there a better way to determine whether or not larger AES key sizes are permitted? Relying on the InvalidKeyException seems fragile, as there are other things that can cause that exception to be thrown.

    [Cipher.getMaxAllowedKeyLength()|http://java.sun.com/javase/6/docs/api/javax/crypto/Cipher.html#getMaxAllowedKeyLength(java.lang.String)]

  • Need to change CSR key size from 1024 to 2048

    Hello SAP experts,
    I am encountering an error when generating new certificates:
    · Invalid Key Size
    Current Key Size: 1024
    The key size in the provided CSR is not valid. The key size must be at
    least 2048. Please attempt the request again. If the problem persists
    contact Entrust Certificate Services support for assistance.
    The CSR was generated using Visual Admin -> Server_Name -> Services ->
    Key Storage -> ServiceSSL ->  Generate CSR
    For ABAP systems, I know that the following parameters can control the
    key size/length:
    sec/dsakeylengthdefault
    sec/rsakeylengthdefault
    Are these parameters applicable to a pure Java stack system?
    How can the CSR key size be changed from 1024 to 2048?
    System: GRC Production
    Installation: NW Installation for GRC
    System Type: Production system
    Product Version: SAP GRC RISK MANAGEMENT 2.0
    Operating System: AIX 5.3
    Database: ORACLE 
    Technical Usage Type: Application Server Java
    Thanks in advance!
    Regards,
    Kris Caldoza

    See knowledgebase article [1548872|http://service.sap.com/~form/handler?_APP=01100107900000000342&_EVENT=REDIR&_NNUM=1548872]
    Cheers, Uwe

  • DMS 5.3 csr public key size

    hello
    i'm planning to install a 3rd party certificate on DMS 5.3. I've had a look at the following documentation:
    http://www.cisco.com/en/US/docs/video/digital_media_systems/5_x/5_3/dms/aai/administration/guide/certs.html#wp1173018
    there doesn't seem to be an option to set the public key size - our certicate provider has specified 2048 bit as a minimum. The default self signed certificate on the DMS is 1024 bit. Does DMS only support 1024 bit and can i use openssl to generate the csr and 2048 bit key and import these into DMS?
    Thanks
    Andy                  

    Hi Andy,
    DMM officially supports only the import of certificates obtained from a CSR request done on the DMM itself, so you could not import cert and keys obtained externally via the AAI.
    I would recommend you to contact your Cisco Account Team for further information regarding the use case you are trying to achieve.
    Regards,
    Marco

  • Change default key size on non Domain joined CA.

    Hello,
    I have one standalone non domain joined CA I would like to change the default key size of all issued certs to 2048.  Since it is a stand along, there are no AD template to modify.  Can this be changed in the registry?
    Shawn

    CAPolicy.inf is the way to go.
    See the following thread
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/ce001d8f-c722-4429-83cb-328b92876292/how-to-change-root-certificate-keys-length-and-validity-period?forum=winserversecurity
    Hth, Anders Janson Enfo Zipper

  • Maximum WPA2 key size for Apple TV (gen 2 & 3)

    Does anyone know the maximum key size for WPA2?  I am using a Airport Extreme with a key size of 63 characters and the Apple TV doesn't seem to accept it.  Before I reconfigure the whole network, I would like to know the max key size versus trial and error (kind of a pain to use the remote to input the characters).

    Ok.. in order to help other users i will post this..
    I have resolved the issue... it was rather simple and dumb...
    I never use windows media player ever.. i do not like it and can not stand it.. because in my case it was a brand new windows installation this fix will only apply to certain users..
    because it was a brand new windows installation.. i had never clicked on windows media player.. apparently streaming settings are embedded into windows media player for the windows 7 OS...    in past installations that i have used for years.. i simply never ever clicked on windows media player, as i never had a reason to.. i use itunes for my ipad, iphone etc.. etc... 
    by accident and shear luck i decided to click on windows media player.. and of course go through the express settings....  after i did this all of my streaming problems to my apple tv gen2 disapeared... HD movies now start almost instantly... so as i stated above apparently there are media streaming settings embedded into the OS through windows media player... doesnt make any sense to me as i never use the program.. but whatever that fixed my issue..
    so for any of you windows 7 people out there using a windows 7 pc as your itunes sync computer and using that itunes library to stream to your apple tv... make sure you have done the initial setup at min.. of windows media player.. i still left itunes as my default player....  everything now works flawlessly... infact for whatever reason.. even in an HD movie my network almost has half the movie synced now accross the bar before the movie starts so now my apple tv is blazing fast....
    i have been struggling with this for 2 days now and simply never gave it a thought that windows media player would ever have anything to do with itunes streaming a totally seperate program.. but it did..
    i hope this helps other people with similar problems.
    good luck

  • Java.security.InvalidKeyException: Illegal key size

    Hi,
    I have developed an adf application using jdeveloper 11g which hosts weblogic 10.3.3.0.
    My adf application has to connect to an external application for credit card validation.
    To achieve this i am using a HTTPURLConnection and passing the external address and attributes that has to be written to it.
    The external application which i am trying to connect is secured starts with https://..
    I get an error as soon i am trying to open the "connection.getOutputStream()".
    Following is the error i am getting
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 3,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=GlobalSign,O=GlobalSign,OU=GlobalSign Root CA - R3". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "OU=Security Communication RootCA2,O=SECOM Trust Systems CO.\,LTD.,C=JP". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=KEYNECTIS ROOT CA,OU=ROOT,O=KEYNECTIS,C=FR". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    java.security.InvalidKeyException: Illegal key size
         at javax.crypto.Cipher.a(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at com.certicom.tls.provider.Cipher.init(Unknown Source)
         at com.certicom.tls.ciphersuite.SecurityParameters.createWriteCipher(Unknown Source)
         at com.certicom.tls.record.handshake.HandshakeHandler.changeCipherSpec(Unknown Source)
         at com.certicom.tls.record.handshake.ClientStateReceivedCertificate.handle(Unknown Source)
         at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessage(Unknown Source)
         at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessages(Unknown Source)
         at com.certicom.tls.record.MessageInterpreter.interpretContent(Unknown Source)
         at com.certicom.tls.record.MessageInterpreter.decryptMessage(Unknown Source)
         at com.certicom.tls.record.ReadHandler.processRecord(Unknown Source)
         at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
         at com.certicom.tls.record.ReadHandler.readUntilHandshakeComplete(Unknown Source)
         at com.certicom.tls.interfaceimpl.TLSConnectionImpl.completeHandshake(Unknown Source)
         at com.certicom.tls.record.WriteHandler.write(Unknown Source)
         at com.certicom.io.OutputSSLIOStreamWrapper.write(Unknown Source)
         at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)The code i am using to connect to the external website is as follows.
        URL url;  
        HttpURLConnection connection = null; 
        try {    
          //Create connection  
          url = new URL(targetURL); 
          connection = (HttpURLConnection)url.openConnection();   
          connection.setRequestMethod("POST");
          connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
         connection.setRequestProperty("Content-Length", "" + Integer.toString(urlParameters.getBytes().length));
          connection.setRequestProperty("Content-Language", "en-US");  
          connection.setUseCaches (false); 
           connection.setDoOutput(true); 
           DataOutputStream wr = new DataOutputStream (      
               connection.getOutputStream ());
                wr.writeBytes (urlParameters);  
                wr.flush ();  
          wr.close ();   
                //Get Response   
          InputStream is = connection.getInputStream();  
          System.out.println("after getting input stream");
        BufferedReader rd = new BufferedReader(new InputStreamReader(is));  
          System.out.println("after BUffered reader");
        String line;  
        StringBuffer response = new StringBuffer();  
          System.out.println("after String buffer");
        while((line = rd.readLine()) != null) {     
          response.append(line);   
          response.append('\r');  
          }      rd.close();  
        return response.toString();
        } catch (Exception e) { 
          e.printStackTrace();   
          return null; 
          } finally { 
          if(connection != null) {      
            connection.disconnect();  
        }I am currently totally clueless , i dont understand what steps should i take. Is this error due to some keystore stuff??
    I even tried to replace the policy files in jre as per some blogs but it still does not work.
    I have very limited knowledge of the security issues with weblogic , i will really appreciate if i can get any links or any help in this matter.
    Thanks in advance
    ash

    The messages prior to the exception are very significant:
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 3,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=GlobalSign,O=GlobalSign,OU=GlobalSign Root CA - R3". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "OU=Security Communication RootCA2,O=SECOM Trust Systems CO.\,LTD.,C=JP". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=KEYNECTIS ROOT CA,OU=ROOT,O=KEYNECTIS,C=FR". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    java.security.InvalidKeyException: Illegal key size
    So there are at least 4 certificates in your server's truststore that are causing issues.
    Is your weblogic server using CustomIdentityAndStandardTrust? If so, the the keystore is the $JAVA_HOME/jre/lib/security/cacerts
    You should familiarize yourself with keytool ( in $JAVA_HOME/bin ) and consider removing entries from your trust store unless you absolutely need them and are willing to trust any cert signed by them. There's been a thread about some newer Certificate Authorities ( CAs ) that were included as part of a recent java upgrade which have caused similar "unknown OID" issues.
    For your specific endpoint, you can use your browser to invoke the services' wsdl; this will cause your browser to fetch the certificate from that server
    You can then see what CA is used to sign it. Then see whether that CA is in your truststore.
    There is also a thread with a very simple class to test the SSL handshake:
    Re: Use Server Cert in Managed server not working

  • Fix vs. variable key size

    Hi,
    in testing (v.4.2, Btree, Red Hat), I'm using an integer printed into a decimal string as a key. I noticed a significant difference in leaf page fill factor (and correspondingly, in db size) depending on whether or not I am using a variable or a fixed size key.
    Specifically, I am left padding the key with whitespaces (in my case, to achieve 8- or 10-bytes long key) when loading, the database actually comes out much more compact (page fill close to 100%) than it is when I do not pad, and keys are of variable (and, for the most part, much shorter) length. With non-padded keys, I get about 51% leaf page fill.
    Padded keys would look like " 1", " 2", etc., while non-padded are "1", "2", etc.
    Afterwards, if I run an update on the entire db (bulk get, update values for a specific key, put back with the same exact key) on the "compact" version of the db, lead page fill factor drops to about 60%, thus bulking the db up.
    Can you please help me understand why is the fill factor so high when the key is fixed size but drops after an update although key size does not change?
    (If I load the original db using non-padded keys, it also grows in size after an update, but perhaps by a couple percent.
    Thank you

    Hi,
    This sounds like a sort-order problem. It is explained in item 5 of the Access Method FAQ here.
    Regards,
    Alex Gorrod
    Oracle Berkeley DB

  • Messaging Server 7.3 msgcert key size

    Does anyone know what key size msgcert uses when generating key pairs? I suspect 1024 bits, but haven't been able to confirm.

    il_postino wrote:
    Does anyone know what key size msgcert uses when generating key pairs? I suspect 1024 bits, but haven't been able to confirm.The msgcert utility does indeed create 1024 bit keys.
    Regards,
    Shane.

  • Key Size error

    Hello All,
    I am using jdk1.4
    I am getting KeySize error for RSA KeySize 1024
    for that i have created .java.policy file and putted into USERHOME
    contents of file are
    grant {
    // There is no restriction to any algorithms.
    permission javax.crypto.CryptoAllPermission;
    Also i have installed Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files
    Still i am getting the errors for KeySize...
    Thanks

    Was there ever solution found for this problem?
    As per note: 419887.1
    It states following:
    =========================================================
    Message: Bad Key Size: 30
    Stack: java.lang.IllegalArgumentException: Bad Key Size: 30
    then the following is applicable :
    1) download jdbc drivers 10.1.0.5 from
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html
    2) apply the drivers downloaded above to the following directory:
    <JDEV HOME>\jdbc\lib
    You will find in this directory the files that needs to be downloaded.
    ==========================================================
    I have done the above but I am still getting the error. I have gone into Project Setting and created an Oracle JDBC 1.4 variable and pointed the ojdbc14.jar to that variable. I then added that variable to the class settings. Is there something else I am missing here?
    Note: I downloaded ojdbc14.jar because the compiler is at 1.4 for my jdeveloper 10.1.2 as per note 419887.1. Should I be using another jdbc classs jar?

  • Can't download itunes because haven't got access to support key

    I can;t download itunes because I don't have access to support key.

    Sorry, that was just a test to make sure that the only thing that needs to be done is fix that registry key problem, however it still needs fixing. If you reboot you'll find that the iPad is no longer picked up.
    Try this:
    1. Please triple-click on the relevant block of text below to select it and then press CTRL+C to copy it.
    32-bit system
    cmd /k REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v iTunesHelper /t REG_SZ /d "\"C:\Program Files\iTunes\iTunesHelper.exe\""
    64-bit system
    cmd /k REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v iTunesHelper /t REG_SZ /d "\"C:\Program Files (x86)\iTunes\iTunesHelper.exe\""
    2. Press the WinLogoKey+R to open the Run... dialog.
    3. Paste the text into the box with CTRL+V and then press enter/return. Overwrite the value if prompted.
    If there is an error please post back the exact text.
    Should you get an "Access denied" error and you know your way around Regedit you could take a look at the current permissions of the Run key and make sure that you have Full Control. This is what I see...
    I have full control since my standard login is a member of the Administrators group which has full control.
    tt2

  • Setting the key size

    Hi,
    I would like to set the key size for encryption. My code is the following:
    private static final String algorithm = "RSA/None/NoPadding";
        private static final String keyAlgorithm = "RSA";
        private static final String providor = "BC";
        private static Cipher cipher = null;
        private static KeyFactory keyFactory = null;
        private static RSAPublicKeySpec pubKeySpec = null;
        private static RSAPrivateKeySpec privKeySpec = null;
        private static RSAPublicKey pubKey = null;
        private static RSAPrivateKey privKey = null;
        static {
            Security.addProvider(new BouncyCastleProvider());
            try {
                cipher = Cipher.getInstance(algorithm, providor);
                keyFactory = KeyFactory.getInstance(keyAlgorithm, providor);
                BigInteger modulus = new BigInteger("d46f473a2d746537de2056ae3092c451", 16);
                BigInteger publicExponent = new BigInteger("11", 16);
                BigInteger privateExponent = new BigInteger("57791d5430d593164082036ad8b29fb1", 16);
                System.out.println(publicExponent + ":" + privateExponent);
                pubKeySpec = new RSAPublicKeySpec(modulus, publicExponent);
                privKeySpec = new RSAPrivateKeySpec(modulus, privateExponent);
                pubKey = (RSAPublicKey) keyFactory.generatePublic(pubKeySpec);
                privKey = (RSAPrivateKey) keyFactory.generatePrivate(privKeySpec);
            } catch (Throwable t) {
                t.printStackTrace();
        }I imagine that the key size is determined by the modulus, but how do I set it to 1024 rather than the 128 which it now is I presume?
    Thanks in advance
    Michael

    I imagine that the key size is determined by the
    modulus, but how do I set it to 1024 rather than the
    128 which it now is I presume?
    128 bytes = 1024 bits.

  • Extend supported icon sizes for AIR Desktop Apps

    Currently AIR Desktop Apps seem to only support a limited set of icon sizes (16x16, 32x32, 48x48, 128x128px).
    It would be great to see bigger icon sizes (like 256x256 and 512x512px) being supported as well. For example, Windows7 does not display 128x128px icon size so the maximum icon size for AIR apps on Windows is currently 48x48px (which actually is pretty small and results in pixelated icons).
    Can you please consider the option of extending supported icon sizes?

    Feature request for this issue: Bug#3844899 - Adobe AIR does not support 256x256 desktop icons on Windows Vista, 7 or 8.x

  • Cannot use blowfish with key size 448 bit length

    I can run it with at most 128 bits key size. I have tried it with 256 and 448 bits key size, all are failed. I'm using j2sdk1.4.1_01. How can I fixed this?
    import java.io.*;
    import javax.crypto.*;
    import java.security.*;
    public class MBlowfish {
         String m_sKeyFile = "";
         public MBlowfish (String sKeyFile) {
              m_sKeyFile = sKeyFile;
         * method genKey()
         public boolean genKey () {
              try {
                   KeyGenerator keygen = KeyGenerator.getInstance ("Blowfish");
                   keygen.init (448);
                   SecretKey key = keygen.generateKey ();
                   ObjectOutputStream keyFile = new ObjectOutputStream (
                        new FileOutputStream (m_sKeyFile)
                   keyFile.writeObject (key);
                   keyFile.close ();
                   return true;
              } catch (Exception e) {
                   //System.out.println (e.getMessage ());
                   return false;
         * method readKey (String sKeyFile)
         private SecretKey readKey () {
              SecretKey key = null;
              try {
                   ObjectInputStream keyFile = new ObjectInputStream (
                        new FileInputStream (m_sKeyFile)
                   key = (SecretKey)keyFile.readObject ();
                   keyFile.close ();
              } catch (Exception e) {
                   //System.out.println (e.getMessage());
              return key;
         public byte[] encrypt (String sInput) {
              Provider sunJce = new com.sun.crypto.provider.SunJCE();
              Security.addProvider (sunJce);
              Cipher cipher = null;
              try {
                   cipher = Cipher.getInstance ("Blowfish/ECB/PKCS5Padding");
                   cipher.init (Cipher.ENCRYPT_MODE, readKey ());
              } catch (Exception e) {
                   System.out.println (e.getMessage());
                   return null;
              try {
                   ByteArrayOutputStream bos = new ByteArrayOutputStream ();
                   ByteArrayInputStream bis = new ByteArrayInputStream (
                        sInput.getBytes());
                   CipherOutputStream cos = new CipherOutputStream (
                        bos, cipher);
                   int length = 0;
                   byte[] buffer = new byte[8192];
                   while ((length = bis.read(buffer)) != -1) {
                        cos.write (buffer, 0, length);
                   cos.close ();
                   bis.close ();
                   bos.close ();
                   return bos.toByteArray();
              } catch (IOException e) {
                   System.out.println (e.getMessage());
                   return null;
         public String decrypt (byte[] baInput) {
              Provider sunJce = new com.sun.crypto.provider.SunJCE();
              Security.addProvider (sunJce);
              Cipher cipher = null;
              try {
                   cipher = Cipher.getInstance ("Blowfish/ECB/PKCS5Padding");
                   cipher.init (Cipher.DECRYPT_MODE, readKey ());
              } catch (Exception e) {
                   System.out.println (e.getMessage());
                   return null;
              try {
                   ByteArrayOutputStream bos = new ByteArrayOutputStream ();
                   ByteArrayInputStream bis = new ByteArrayInputStream (
                        baInput);
                   CipherOutputStream cos = new CipherOutputStream (
                        bos, cipher);
                   int length = 0;
                   byte[] buffer = new byte[8192];
                   while ((length = bis.read(buffer)) != -1) {
                        cos.write (buffer, 0, length);
                   cos.close ();
                   bis.close ();
                   bos.close ();
                   return new String(bos.toByteArray());
              } catch (Exception e) {
                   System.out.println (e.getMessage());
                   return null;
         public static void main (String args[]) {
              MBlowfish m = new MBlowfish ("BlowfishKey.ser");
              boolean result = m.genKey ();
              if (result) {
                   System.out.println ("OK");
              } else {
                   System.out.println ("Fail");
              byte[] baEncrypted = m.encrypt ("Hello this is a test message.");
              System.out.println (m.decrypt (baEncrypted));
    }

    Hi vorrarit,
    sorry I couldn't help you. I tried your code one-to-one on my system and everything worked fine, which means that your configuration is somewhat messy.
    BTW I read a little about jce and java 1.4.x (for I have java 1.3.06 and extra jce package), the documentation says, the SUN JCE providers are statically preconfigured, so a Security.addProvider(..) is not necessary. Have a look in the java.security file and check if the sun provider is contained. Are you sure, your runtime version points to the directory where the jce is installed, maybe you had installed other java-versions and the pathes got mixed up?
    Good luck,
    sebastian

Maybe you are looking for

  • UPK 3.6.1 Gkn.OnDemand.Library.OfflineException - Possible solution

    Hi all, Apology if this has been posted already, but I search Oracle articles/forums/support and various websites and couldn't find any solution until I just happen to stumble upon it by chance. I thought I'd try and share this solution in case someo

  • Oracle 8.1.7 on SuSE 6.4

    Can anyone recommend a procedure to install Oracle 8.1.7 on SuSE 6.4. It is for practice only so security is not an issue. My unix/linux is basic and I am new to Oracle. I am doing an Oracle dba subject at uni this semester and need access to 8i at h

  • How to install new instance on Stellent Content Server

    Hi All, I have installed Stellent Admin Server and Content Server with the instance name "idc". Now I want to install one more content server "idc1" on same Admin server. So is there any appropriate way to do this? Please let me know. Thanks & Regard

  • Using a 27-inch iMac as an external display for my macbook air

    I would like Using a 27-inch iMac as an external display for my mac book air. i bought a Mini DisplayPort to Mini DisplayPort cable, it's the Belkin Mini DisplayPort to Mini DisplayPort cable on apple store. I connect my imac and mac book air with th

  • Restrict all goods movements for materials untill the latest costing run ex

    Hi dudes, 1 here i have a requirement that i need to restrict all goods movements in the month for all materials(SFG,FG) untill the latest costing run(standard cost estimate) on 1st of each month. 2. Can we restrict the status of process order in suc