encryption keysize restriction

Discussion in 'Java' started by harryos, Nov 12, 2008.

  1. harryos

    harryos Guest

    hi
    i tried to use 192 bit encryption like below

    Cipher c = Cipher.getInstance("Blowfish/ECB/NoPadding");
    // create a 192 bit secret key from raw bytes
    SecretKey key192 = new SecretKeySpec(
    new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
    0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,0x10, 0x11, 0x12, 0x13,
    0x14, 0x15, 0x16, 0x17 },"Blowfish");
    //try encrypting with the 192bit key
    c.init(Cipher.ENCRYPT_MODE, key192);
    c.doFinal(data);
    System.out.println("192 bit test: passed");


    ....
    the above code gives an invalid keysize error..I live outside U.S..and
    am using java 1.6.0_05-b13 .so i don't know if i can use larger keys
    for encryption..I read about 'unrestricted policy files' in some java
    book..Is there such a policy file ?I couldn't find any on sun java
    site

    any help wd be most welcome
    thanks
    harry
     
    harryos, Nov 12, 2008
    #1
    1. Advertising

  2. > the above code gives an invalid keysize error..I live outside U.S..and
    > am using java 1.6.0_05-b13 .so i don't know if i can use larger keys
    > for encryption..I read about 'unrestricted policy files' in some java
    > book..Is there such a policy file ?I couldn't find any on sun java
    > site


    http://java.sun.com > JavaSE > Downloads > Other downloads (bottom of
    the page).

    Ronny
     
    Ronny Schuetz, Nov 12, 2008
    #2
    1. Advertising

  3. harryos

    harryos Guest

    Plase do not ever use ECB mode unless you want the attacker to be
    able to read your cyphertext.
    > Seehttp://www.bouncycastle.org/java.html
    > > I am puzzled as to why you are using Blowfish


    thanx rossum for the reply
    I was going thru a book on cryptography using java..The book uses
    Blowfish Encryption and ECB..they also mentioned the use of
    unrestricted policy file.

    I will keep your advice in mind and will use AES instead.
    thanks again
    harry
     
    harryos, Nov 12, 2008
    #3
  4. harryos

    Roedy Green Guest

    On Tue, 11 Nov 2008 22:17:31 -0800 (PST), harryos
    <> wrote, quoted or indirectly quoted someone
    who said :

    >...
    >the above code gives an invalid keysize error..I live outside U.S


    This law is downright silly.

    1. it is a US law, so it has no effect on people in other countries.

    2. It prevents US corporations from selling encryption to
    non-Americans. But all the US corporation is required to do, is ask
    where the customer lives. If the customer lies, the US corporation is
    off the hook.

    3. All the cryptographic algorithms are published openly, so they can
    all be recoded. The law does not protect any secrets.

    4. With absolutely minimal effort non-Americans can get the software.

    5. The law mainly has the effect of stimulating the Australian
    cryptographic industry, sending corporate sales to them.

    6. It is a politicians' law to spread a false fog of doing something.
    It was framed by people with no understanding whatsoever of the
    technology.

    7. It allows Canadians to have the encryption software, but has no
    teeth to stop Canadians from passing it on.

    8. It loses sales for US companies.

    see
    http://java.sun.com/javase/technologies/security/#UnlimitedDownload
    for add on to improve JCE encryption strength.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    Your old road is
    Rapidly agin'.
    Please get out of the new one
    If you can't lend your hand
    For the times they are a-changin'.
     
    Roedy Green, Nov 12, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RWQ=?=

    file restriction - Forms authentication

    =?Utf-8?B?RWQ=?=, May 31, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    396
    Jim Cheshire [MSFT]
    Jun 1, 2004
  2. =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=

    Scripted Window Restriction?

    =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=, Oct 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    411
    =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=
    Oct 5, 2004
  3. z f
    Replies:
    2
    Views:
    5,137
  4. Ning

    pycrypto 3DES keysize

    Ning, Dec 13, 2006, in forum: Python
    Replies:
    2
    Views:
    453
  5. Phil C.
    Replies:
    3
    Views:
    272
    Joe Kaplan \(MVP - ADSI\)
    Feb 25, 2005
Loading...

Share This Page