Encryption  
Author Message
ian_desouza





PostPosted: 2003-7-10 5:43:00 Top

java-programmer, Encryption Simple question... sorry..

I'm trying to encrypt a string with a private key (retrieved from
KeyStore - that I created using keytool). So that I can send the
public key to the client to decrypt the string.

The problem I'm having is (partially from the Java's Developer's
Almanac).

java.security.InvalidKeyException
at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA6275)
at javax.crypto.Cipher.init(DashoA6275)
at DesEncrypter.<init>(DesEncrypter.java:24)

DesEncrypter(Key key)
throws InvalidAlgorithmParameterException, NoSuchPaddingException,
NoSuchAlgorithmException, InvalidKeyException
{
// Create an 8-byte initialization vector
// byte[] iv = new byte[]{
// (byte)0x8E, 0x12, 0x39, (byte)0x9C,
// 0x07, 0x72, 0x6F, 0x5A
// };
// AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");

// CBC requires an initialization vector
24: ecipher.init(Cipher.ENCRYPT_MODE, key); //, paramSpec);

The "key" problem I'm having is that the code actually uses the
"SecretKey" to the class, but I'm retrieving a "Key" private key from
the store.

I know I'm missing something..

Ian
 
JK





PostPosted: 2003-7-10 17:13:00 Top

java-programmer >> Encryption You are missing, that in JCE keys are typed to match the requirements of
the cipher. In a key store, you can store private keys for RSA or DSA,
but not for a symmetric cipher such as DES.

As asymmetric encrytion/decryption is a lot more computationally
intensive, you usually use a symmetric cipher for the bulk encryption of
data using a random key, and append (or prepend) the symmetric key
encrypted with an asymmetric cipher (RSA or DSA) using your private key.
For decryption, your public key is used to recover the secret symetric
key and having that key, the actually data can be decrypted.

Regards
JK.



Ian deSouza wrote:
> Simple question... sorry..
>
> I'm trying to encrypt a string with a private key (retrieved from
> KeyStore - that I created using keytool). So that I can send the
> public key to the client to decrypt the string.
>
> The problem I'm having is (partially from the Java's Developer's
> Almanac).
>
> java.security.InvalidKeyException
> at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA6275)
> at javax.crypto.Cipher.init(DashoA6275)
> at DesEncrypter.<init>(DesEncrypter.java:24)
>
> DesEncrypter(Key key)
> throws InvalidAlgorithmParameterException, NoSuchPaddingException,
> NoSuchAlgorithmException, InvalidKeyException
> {
> // Create an 8-byte initialization vector
> // byte[] iv = new byte[]{
> // (byte)0x8E, 0x12, 0x39, (byte)0x9C,
> // 0x07, 0x72, 0x6F, 0x5A
> // };
> // AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
> ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
> dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
>
> // CBC requires an initialization vector
> 24: ecipher.init(Cipher.ENCRYPT_MODE, key); //, paramSpec);
>
> The "key" problem I'm having is that the code actually uses the
> "SecretKey" to the class, but I'm retrieving a "Key" private key from
> the store.
>
> I know I'm missing something..
>
> Ian

 
ian_desouza





PostPosted: 2003-7-10 23:35:00 Top

java-programmer >> Encryption Thank you JK!

I think I understood that. The concern is that large amounts of data
would be better encripted using the less time consuming symmetric key.
But I only have a small amount of data I wish to decrypt. e.g.

I have a properties file with small string values that I wish to
decrypt with my public key that I ship with the product. I encrypt the
small values with my private key at home base and put them in my
properties file.

So if this is the case, what algorithym should I set up my cipher for
(at home) using my "keytool -genkey" generated key? i.e.

Sun DSA Private Key
parameters:DSA
p: fd7f5381 1d751229 52df4a9c 2eece4e7 f611b752 3cef4400 c31e3f80
b6512669
455d4022 51fb593d 8d58fabf c5f5ba30 f6cb9b55 6cd7813b 801d346f
f26660b7
6b9950a5 a49f9fe8 047b1022 c24fbba9 d7feb7c6 1bf83b57 e7c6a8a6
150f04fb
83f6d3c5 1ec30235 54135a16 9132f675 f3ae2b61 d72aeff2 2203199d
d14801c7
q: 9760508f 15230bcc b292b982 a2eb840b f0581cf5
g: f7e1a085 d69b3dde cbbcab5c 36b857b9 7994afbb fa3aea82 f9574c0b
3d078267
5159578e bad4594f e6710710 8180b449 167123e8 4c281613 b7cf0932
8cc8a6e1
3c167a8b 547c8d28 e0a3ae1e 2bb3a675 916ea37f 0bfa2135 62f1fb62
7a01243b
cca4f1be a8519089 a883dfe1 5ae59f06 928b665e 807b5525 64014c3b
fecf492a

x: 72433d46 3e452130 bcf4db29 4b30f3cf 5e17ea81

Don't worry, I'm only using this for testing...

And if I have a public key as follows:

Sun DSA Public Key
Parameters:DSA
p: fd7f5381 1d751229 52df4a9c 2eece4e7 f611b752 3cef4400 c31e3f80
b6512669
455d4022 51fb593d 8d58fabf c5f5ba30 f6cb9b55 6cd7813b 801d346f
f26660b7
6b9950a5 a49f9fe8 047b1022 c24fbba9 d7feb7c6 1bf83b57 e7c6a8a6
150f04fb
83f6d3c5 1ec30235 54135a16 9132f675 f3ae2b61 d72aeff2 2203199d
d14801c7
q: 9760508f 15230bcc b292b982 a2eb840b f0581cf5
g: f7e1a085 d69b3dde cbbcab5c 36b857b9 7994afbb fa3aea82 f9574c0b
3d078267
5159578e bad4594f e6710710 8180b449 167123e8 4c281613 b7cf0932
8cc8a6e1
3c167a8b 547c8d28 e0a3ae1e 2bb3a675 916ea37f 0bfa2135 62f1fb62
7a01243b
cca4f1be a8519089 a883dfe1 5ae59f06 928b665e 807b5525 64014c3b
fecf492a

y:
2a1c4ccd 0752ead3 d9100774 95efb3b3 06a35a6a c9ac583c 93c8c647
58fe8fe7
de862e36 b70e2f30 5e9ae836 37aca933 dadb16c1 6dae9cf7 47b442e4
a63539e1
ded87dcf 2299900c 3895729c bf6d06d3 6dfcfe60 c256bdd4 701313ff
758c8b6f
f3a5ce4d 8410ac3c 73d9c2ac 4645b605 c1cd7da8 be2ff818 0babc883
65d3f057

What algorithm would I use to init the Cipher to decrypt the small
string?

Thanks again for any help! Ian


JK <email***@***.com> wrote in message news:<bej9uk$14e$email***@***.com>...
> You are missing, that in JCE keys are typed to match the requirements of
> the cipher. In a key store, you can store private keys for RSA or DSA,
> but not for a symmetric cipher such as DES.
>
> As asymmetric encrytion/decryption is a lot more computationally
> intensive, you usually use a symmetric cipher for the bulk encryption of
> data using a random key, and append (or prepend) the symmetric key
> encrypted with an asymmetric cipher (RSA or DSA) using your private key.
> For decryption, your public key is used to recover the secret symetric
> key and having that key, the actually data can be decrypted.
>
> Regards
> JK.
>
>
>
> Ian deSouza wrote:
> > Simple question... sorry..
> >
> > I'm trying to encrypt a string with a private key (retrieved from
> > KeyStore - that I created using keytool). So that I can send the
> > public key to the client to decrypt the string.
> >
> > The problem I'm having is (partially from the Java's Developer's
> > Almanac).
> >
> > java.security.InvalidKeyException
> > at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA6275)
> > at javax.crypto.Cipher.init(DashoA6275)
> > at DesEncrypter.<init>(DesEncrypter.java:24)
> >
> > DesEncrypter(Key key)
> > throws InvalidAlgorithmParameterException, NoSuchPaddingException,
> > NoSuchAlgorithmException, InvalidKeyException
> > {
> > // Create an 8-byte initialization vector
> > // byte[] iv = new byte[]{
> > // (byte)0x8E, 0x12, 0x39, (byte)0x9C,
> > // 0x07, 0x72, 0x6F, 0x5A
> > // };
> > // AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
> > ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
> > dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
> >
> > // CBC requires an initialization vector
> > 24: ecipher.init(Cipher.ENCRYPT_MODE, key); //, paramSpec);
> >
> > The "key" problem I'm having is that the code actually uses the
> > "SecretKey" to the class, but I'm retrieving a "Key" private key from
> > the store.
> >
> > I know I'm missing something..
> >
> > Ian
 
 
JK





PostPosted: 2003-7-11 16:56:00 Top

java-programmer >> Encryption You can't use DSA for encryption because it is an algorithm for signing
only.

Sun's JCE does not support RSA encryption (just signing). Get the
bouncycastle JCE (www.bouncycastle.org).

You have to generate an RSA key pair instead (keytool) and use RSA e.g.
with OAEP padding

Cipher cipher = Cipher.getInstance("RSA/OAEP", "BC");

I'd recommend to read a good book about cryptography to get things
clearer, e.g. "Applied Cryptography" by Bruce Schneier.

Regards
JK.



Ian deSouza wrote:
> Thank you JK!
>
> I think I understood that. The concern is that large amounts of data
> would be better encripted using the less time consuming symmetric key.
> But I only have a small amount of data I wish to decrypt. e.g.
>
> I have a properties file with small string values that I wish to
> decrypt with my public key that I ship with the product. I encrypt the
> small values with my private key at home base and put them in my
> properties file.
>
> So if this is the case, what algorithym should I set up my cipher for
> (at home) using my "keytool -genkey" generated key? i.e.
>
> Sun DSA Private Key
> parameters:DSA
> p: fd7f5381 1d751229 52df4a9c 2eece4e7 f611b752 3cef4400 c31e3f80
> b6512669
> 455d4022 51fb593d 8d58fabf c5f5ba30 f6cb9b55 6cd7813b 801d346f
> f26660b7
> 6b9950a5 a49f9fe8 047b1022 c24fbba9 d7feb7c6 1bf83b57 e7c6a8a6
> 150f04fb
> 83f6d3c5 1ec30235 54135a16 9132f675 f3ae2b61 d72aeff2 2203199d
> d14801c7
> q: 9760508f 15230bcc b292b982 a2eb840b f0581cf5
> g: f7e1a085 d69b3dde cbbcab5c 36b857b9 7994afbb fa3aea82 f9574c0b
> 3d078267
> 5159578e bad4594f e6710710 8180b449 167123e8 4c281613 b7cf0932
> 8cc8a6e1
> 3c167a8b 547c8d28 e0a3ae1e 2bb3a675 916ea37f 0bfa2135 62f1fb62
> 7a01243b
> cca4f1be a8519089 a883dfe1 5ae59f06 928b665e 807b5525 64014c3b
> fecf492a
>
> x: 72433d46 3e452130 bcf4db29 4b30f3cf 5e17ea81
>
> Don't worry, I'm only using this for testing...
>
> And if I have a public key as follows:
>
> Sun DSA Public Key
> Parameters:DSA
> p: fd7f5381 1d751229 52df4a9c 2eece4e7 f611b752 3cef4400 c31e3f80
> b6512669
> 455d4022 51fb593d 8d58fabf c5f5ba30 f6cb9b55 6cd7813b 801d346f
> f26660b7
> 6b9950a5 a49f9fe8 047b1022 c24fbba9 d7feb7c6 1bf83b57 e7c6a8a6
> 150f04fb
> 83f6d3c5 1ec30235 54135a16 9132f675 f3ae2b61 d72aeff2 2203199d
> d14801c7
> q: 9760508f 15230bcc b292b982 a2eb840b f0581cf5
> g: f7e1a085 d69b3dde cbbcab5c 36b857b9 7994afbb fa3aea82 f9574c0b
> 3d078267
> 5159578e bad4594f e6710710 8180b449 167123e8 4c281613 b7cf0932
> 8cc8a6e1
> 3c167a8b 547c8d28 e0a3ae1e 2bb3a675 916ea37f 0bfa2135 62f1fb62
> 7a01243b
> cca4f1be a8519089 a883dfe1 5ae59f06 928b665e 807b5525 64014c3b
> fecf492a
>
> y:
> 2a1c4ccd 0752ead3 d9100774 95efb3b3 06a35a6a c9ac583c 93c8c647
> 58fe8fe7
> de862e36 b70e2f30 5e9ae836 37aca933 dadb16c1 6dae9cf7 47b442e4
> a63539e1
> ded87dcf 2299900c 3895729c bf6d06d3 6dfcfe60 c256bdd4 701313ff
> 758c8b6f
> f3a5ce4d 8410ac3c 73d9c2ac 4645b605 c1cd7da8 be2ff818 0babc883
> 65d3f057
>
> What algorithm would I use to init the Cipher to decrypt the small
> string?
>
> Thanks again for any help! Ian
>
>
> JK <email***@***.com> wrote in message news:<bej9uk$14e$email***@***.com>...
>
>>You are missing, that in JCE keys are typed to match the requirements of
>>the cipher. In a key store, you can store private keys for RSA or DSA,
>>but not for a symmetric cipher such as DES.
>>
>>As asymmetric encrytion/decryption is a lot more computationally
>>intensive, you usually use a symmetric cipher for the bulk encryption of
>>data using a random key, and append (or prepend) the symmetric key
>>encrypted with an asymmetric cipher (RSA or DSA) using your private key.
>>For decryption, your public key is used to recover the secret symetric
>>key and having that key, the actually data can be decrypted.
>>
>>Regards
>>JK.
>>
>>
>>
>>Ian deSouza wrote:
>>
>>>Simple question... sorry..
>>>
>>>I'm trying to encrypt a string with a private key (retrieved from
>>>KeyStore - that I created using keytool). So that I can send the
>>>public key to the client to decrypt the string.
>>>
>>>The problem I'm having is (partially from the Java's Developer's
>>>Almanac).
>>>
>>>java.security.InvalidKeyException
>>> at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA6275)
>>> at javax.crypto.Cipher.init(DashoA6275)
>>> at DesEncrypter.<init>(DesEncrypter.java:24)
>>>
>>> DesEncrypter(Key key)
>>> throws InvalidAlgorithmParameterException, NoSuchPaddingException,
>>>NoSuchAlgorithmException, InvalidKeyException
>>> {
>>> // Create an 8-byte initialization vector
>>>// byte[] iv = new byte[]{
>>>// (byte)0x8E, 0x12, 0x39, (byte)0x9C,
>>>// 0x07, 0x72, 0x6F, 0x5A
>>>// };
>>>// AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
>>> ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
>>> dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
>>>
>>> // CBC requires an initialization vector
>>>24: ecipher.init(Cipher.ENCRYPT_MODE, key); //, paramSpec);
>>>
>>>The "key" problem I'm having is that the code actually uses the
>>>"SecretKey" to the class, but I'm retrieving a "Key" private key from
>>>the store.
>>>
>>>I know I'm missing something..
>>>
>>>Ian

 
 
ian_desouza





PostPosted: 2003-7-11 22:43:00 Top

java-programmer >> Encryption Thank you JK (again). I'm going to get the book. Also will look into
the boucycastle JCE.

Thanks again!, Ian

JK <email***@***.com> wrote in message news:<beltan$a82$email***@***.com>...
> You can't use DSA for encryption because it is an algorithm for signing
> only.
>
> Sun's JCE does not support RSA encryption (just signing). Get the
> bouncycastle JCE (www.bouncycastle.org).
>
> You have to generate an RSA key pair instead (keytool) and use RSA e.g.
> with OAEP padding
>
> Cipher cipher = Cipher.getInstance("RSA/OAEP", "BC");
>
> I'd recommend to read a good book about cryptography to get things
> clearer, e.g. "Applied Cryptography" by Bruce Schneier.
>
> Regards
> JK.
>
>
>
> Ian deSouza wrote:
> > Thank you JK!
> >
> > I think I understood that. The concern is that large amounts of data
> > would be better encripted using the less time consuming symmetric key.
> > But I only have a small amount of data I wish to decrypt. e.g.
> >
> > I have a properties file with small string values that I wish to
> > decrypt with my public key that I ship with the product. I encrypt the
> > small values with my private key at home base and put them in my
> > properties file.
> >
> > So if this is the case, what algorithym should I set up my cipher for
> > (at home) using my "keytool -genkey" generated key? i.e.
> >
> > Sun DSA Private Key
> > parameters:DSA
> > p: fd7f5381 1d751229 52df4a9c 2eece4e7 f611b752 3cef4400 c31e3f80
> > b6512669
> > 455d4022 51fb593d 8d58fabf c5f5ba30 f6cb9b55 6cd7813b 801d346f
> > f26660b7
> > 6b9950a5 a49f9fe8 047b1022 c24fbba9 d7feb7c6 1bf83b57 e7c6a8a6
> > 150f04fb
> > 83f6d3c5 1ec30235 54135a16 9132f675 f3ae2b61 d72aeff2 2203199d
> > d14801c7
> > q: 9760508f 15230bcc b292b982 a2eb840b f0581cf5
> > g: f7e1a085 d69b3dde cbbcab5c 36b857b9 7994afbb fa3aea82 f9574c0b
> > 3d078267
> > 5159578e bad4594f e6710710 8180b449 167123e8 4c281613 b7cf0932
> > 8cc8a6e1
> > 3c167a8b 547c8d28 e0a3ae1e 2bb3a675 916ea37f 0bfa2135 62f1fb62
> > 7a01243b
> > cca4f1be a8519089 a883dfe1 5ae59f06 928b665e 807b5525 64014c3b
> > fecf492a
> >
> > x: 72433d46 3e452130 bcf4db29 4b30f3cf 5e17ea81
> >
> > Don't worry, I'm only using this for testing...
> >
> > And if I have a public key as follows:
> >
> > Sun DSA Public Key
> > Parameters:DSA
> > p: fd7f5381 1d751229 52df4a9c 2eece4e7 f611b752 3cef4400 c31e3f80
> > b6512669
> > 455d4022 51fb593d 8d58fabf c5f5ba30 f6cb9b55 6cd7813b 801d346f
> > f26660b7
> > 6b9950a5 a49f9fe8 047b1022 c24fbba9 d7feb7c6 1bf83b57 e7c6a8a6
> > 150f04fb
> > 83f6d3c5 1ec30235 54135a16 9132f675 f3ae2b61 d72aeff2 2203199d
> > d14801c7
> > q: 9760508f 15230bcc b292b982 a2eb840b f0581cf5
> > g: f7e1a085 d69b3dde cbbcab5c 36b857b9 7994afbb fa3aea82 f9574c0b
> > 3d078267
> > 5159578e bad4594f e6710710 8180b449 167123e8 4c281613 b7cf0932
> > 8cc8a6e1
> > 3c167a8b 547c8d28 e0a3ae1e 2bb3a675 916ea37f 0bfa2135 62f1fb62
> > 7a01243b
> > cca4f1be a8519089 a883dfe1 5ae59f06 928b665e 807b5525 64014c3b
> > fecf492a
> >
> > y:
> > 2a1c4ccd 0752ead3 d9100774 95efb3b3 06a35a6a c9ac583c 93c8c647
> > 58fe8fe7
> > de862e36 b70e2f30 5e9ae836 37aca933 dadb16c1 6dae9cf7 47b442e4
> > a63539e1
> > ded87dcf 2299900c 3895729c bf6d06d3 6dfcfe60 c256bdd4 701313ff
> > 758c8b6f
> > f3a5ce4d 8410ac3c 73d9c2ac 4645b605 c1cd7da8 be2ff818 0babc883
> > 65d3f057
> >
> > What algorithm would I use to init the Cipher to decrypt the small
> > string?
> >
> > Thanks again for any help! Ian
> >
> >
> > JK <email***@***.com> wrote in message news:<bej9uk$14e$email***@***.com>...
> >
> >>You are missing, that in JCE keys are typed to match the requirements of
> >>the cipher. In a key store, you can store private keys for RSA or DSA,
> >>but not for a symmetric cipher such as DES.
> >>
> >>As asymmetric encrytion/decryption is a lot more computationally
> >>intensive, you usually use a symmetric cipher for the bulk encryption of
> >>data using a random key, and append (or prepend) the symmetric key
> >>encrypted with an asymmetric cipher (RSA or DSA) using your private key.
> >>For decryption, your public key is used to recover the secret symetric
> >>key and having that key, the actually data can be decrypted.
> >>
> >>Regards
> >>JK.
> >>
> >>
> >>
> >>Ian deSouza wrote:
> >>
> >>>Simple question... sorry..
> >>>
> >>>I'm trying to encrypt a string with a private key (retrieved from
> >>>KeyStore - that I created using keytool). So that I can send the
> >>>public key to the client to decrypt the string.
> >>>
> >>>The problem I'm having is (partially from the Java's Developer's
> >>>Almanac).
> >>>
> >>>java.security.InvalidKeyException
> >>> at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA6275)
> >>> at javax.crypto.Cipher.init(DashoA6275)
> >>> at DesEncrypter.<init>(DesEncrypter.java:24)
> >>>
> >>> DesEncrypter(Key key)
> >>> throws InvalidAlgorithmParameterException, NoSuchPaddingException,
> >>>NoSuchAlgorithmException, InvalidKeyException
> >>> {
> >>> // Create an 8-byte initialization vector
> >>>// byte[] iv = new byte[]{
> >>>// (byte)0x8E, 0x12, 0x39, (byte)0x9C,
> >>>// 0x07, 0x72, 0x6F, 0x5A
> >>>// };
> >>>// AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
> >>> ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
> >>> dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
> >>>
> >>> // CBC requires an initialization vector
> >>>24: ecipher.init(Cipher.ENCRYPT_MODE, key); //, paramSpec);
> >>>
> >>>The "key" problem I'm having is that the code actually uses the
> >>>"SecretKey" to the class, but I'm retrieving a "Key" private key from
> >>>the store.
> >>>
> >>>I know I'm missing something..
> >>>
> >>>Ian
 
 
VK





PostPosted: 2003-10-20 6:23:00 Top

java-programmer >> Encryption The law prosecute actions, not consequences.

Someone is going on electric chair because he killed a man, not because
that man died.

The same way export restrictions apply on inscription tools and
technology, and not consequences (encrypted data).

So if you decide to go to a Taliban-controlled area of Afganistan (I
would NOT suggest :-) , you are legally OK to take any encrypted data
you like.
But it's not OK to bring with you any software to decode this data or to
produce another encoded data.


Roedy Green <email***@***.com> wrote in message
news:email***@***.com...
> Do the US restrictions on good encryption refer only to electronic
> communications, or do they also refer to how you encrypt your files
> for your own use. Would they apply for example if someone visited the
> country with their files encrypted on a lap top? Do they apply only
> to electronic communication, or to CD's shipped my mail as well?
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


 
 
Michael Amling





PostPosted: 2003-10-20 11:33:00 Top

java-programmer >> Encryption Roedy Green wrote:
> Do the US restrictions on good encryption refer only to electronic
> communications, or do they also refer to how you encrypt your files
> for your own use. Would they apply for example if someone visited the
> country with their files encrypted on a lap top? Do they apply only
> to electronic communication, or to CD's shipped my mail as well?

There's an exemption for software you take with you for personal use;
if nothing else, most laptops have a 128-bit SSL implementation in a
browser. The regulations apply to all exports, although they apply
different rules to different media. E.g. AFAIK, nothing in book form is
restricted.
You seem like the kind of person who could just wade through the regs
yourself, starting at http://www.bxa.doc.gov/Encryption/Default.htm. But
don't expect to get your answers in one sitting.
For a definitive answer, there are lawyers with expertise in this area.

--Mike Amling

 
 
Michael Amling





PostPosted: 2003-10-20 21:18:00 Top

java-programmer >> Encryption Roedy Green wrote:
> On Mon, 20 Oct 2003 03:33:06 GMT, Michael Amling <email***@***.com>
> wrote or quoted :
>
>> You seem like the kind of person who could just wade through the regs
>>yourself, starting at http://www.bxa.doc.gov/Encryption/Default.htm. But
>>don't expect to get your answers in one sitting.
>> For a definitive answer, there are lawyers with expertise in this area.
>
> The question I am getting at is, would I get in trouble if I invented
> a one-time pad XOR scheme for both sending secret messages and
> encrypting personal files that used random FM noise to create the
> keys.

Well, OTP has its pitfalls. Cheap but effective cryptographic random
number generating hardware would also be nice for other uses.
Other than distinguishing hardware from software and key lengths
equivalent to >56 bits symmetric from key lengths <=56 bits, the regs
don't much care what the encryption technique is.

> I am a Canadian and live in Canada. The people most likely
> might use such a thing are Americans who travel a lot.

US export regulations don't apply to you if you're not exporting any
crypto from the USA. If your customers tell you credibly that it's for
their own use and not for reexport, you're as much off the hook as
distributors of 128-bit browsers are.

>
> I am not trying to shave the law. I want to understand the spirit of
> it.

We would all like to see a concise cogent version of the regulations,
a summary, a generalization, a spirit.

--Mike Amling

 
 
David Goulet





PostPosted: 2004-1-31 5:11:00 Top

java-programmer >> Encryption Hi,
I want to encrypt a big String with a password entered by the user.
How can I create a Blowfish key with that password??

I try by the PBEfactory but Blowfish doesn't appear in this class.

thanks
David


 
 
jPro9102





PostPosted: 2004-4-29 20:33:00 Top

java-programmer >> Encryption heres a program that incrypts files. comlpeate with 'regestration',
I/O file writing, and a help menu with a scroll pane. try it out and
tell me how u like it in a posting! no e-mail please!
-Ben
 
 
Christophe Vanfleteren





PostPosted: 2004-4-29 20:37:00 Top

java-programmer >> Encryption Ben Aroia wrote:

> heres a program that incrypts files. comlpeate with 'regestration',
> I/O file writing, and a help menu with a scroll pane. try it out and
> tell me how u like it in a posting! no e-mail please!
> -Ben

I tried it. It is very cool. I really like the fact that it used I/O file
writing to encrypt my files.

--
Kind regards,
Christophe Vanfleteren
 
 
RotterdamStudents





PostPosted: 2004-5-4 15:33:00 Top

java-programmer >> Encryption Hello group,

to give access to some of my pages I use a loginscript. When people register
the password is encrypted with the md5 function: $passw=md5("$inv_passw");

Now I want to have the user to ask for his password when he lost it by mail.
So the encrypted password needs to be decrypted. I thought to use the next
command:
$uncrypted = decrypt_md5($assw);

but this gives a fault:
Fatal error: Call to undefined function: decrypt_md5()

Can somebody tell me what I do wrong.

Thnx in advance.

RotterdamStudents


 
 
Jeppe Uhd





PostPosted: 2004-5-4 16:11:00 Top

java-programmer >> Encryption RotterdamStudents wrote:
> Hello group,
>
> to give access to some of my pages I use a loginscript. When people
> register the password is encrypted with the md5 function:
> $passw=md5("$inv_passw");
>
> Now I want to have the user to ask for his password when he lost it
> by mail. So the encrypted password needs to be decrypted. I thought
> to use the next command:
> $uncrypted = decrypt_md5($assw);
>
> but this gives a fault:
> Fatal error: Call to undefined function: decrypt_md5()
>
> Can somebody tell me what I do wrong.

md5 -can't- be decrypted... It's a one-way hash function

--
MVH Jeppe Uhd - NX http://nx.dk
Webhosting for né´•der og andet godtfolk


 
 
Chris Hope





PostPosted: 2004-5-4 16:16:00 Top

java-programmer >> Encryption Jeppe Uhd wrote:

>> to give access to some of my pages I use a loginscript. When people
>> register the password is encrypted with the md5 function:
>> $passw=md5("$inv_passw");
>>
>> Now I want to have the user to ask for his password when he lost it
>> by mail. So the encrypted password needs to be decrypted. I thought
>> to use the next command:
>> $uncrypted = decrypt_md5($assw);
>>
>> but this gives a fault:
>> Fatal error: Call to undefined function: decrypt_md5()
>>
>> Can somebody tell me what I do wrong.
>
> md5 -can't- be decrypted... It's a one-way hash function

And there's no such function as decrypt_md5(), hence the error message :)

If you want to check a function go to www.php.net/function_name where
function_name is the name of the function you want more info on. If the
function exists you'll be taken directly to the manual page. If it doesn't
then you'll be given a list of functions with similar names.
 
 
Berislav Lopac





PostPosted: 2004-5-4 16:47:00 Top

java-programmer >> Encryption RotterdamStudents wrote:
> Hello group,
>
> to give access to some of my pages I use a loginscript. When people
> register the password is encrypted with the md5 function:
> $passw=md5("$inv_passw");
>
> Now I want to have the user to ask for his password when he lost it
> by mail. So the encrypted password needs to be decrypted. I thought
> to use the next command:
> $uncrypted = decrypt_md5($assw);
>
> but this gives a fault:
> Fatal error: Call to undefined function: decrypt_md5()
>
> Can somebody tell me what I do wrong.

Most of all, you're trying to decrypt.

Instead of this, when someone loses the password you should create a new one
and send it, and write that new one into database, encrypted.

Berislav


 
 
Kevin





PostPosted: 2004-12-22 1:46:00 Top

java-programmer >> Encryption I am trying to re-write a Perl program in Java (don't ask why ;-)

I am having problems finding Java equivalents for the Perl encode_base64,
used for encoding files for transmission, and crypt, used for encrypting
passwords, functions.

Can anyone help me?

There does seem to be some encryption support in Java but it isn't clear how
to use it in place of the Perl functions mentioned.

Cheers,
K


 
 
Juha Laiho





PostPosted: 2004-12-22 2:48:00 Top

java-programmer >> Encryption "Kevin" <email***@***.com> said:
>I am having problems finding Java equivalents for the Perl encode_base64,
>used for encoding files for transmission, and crypt, used for encrypting
>passwords, functions.

For base64-encoding, it looks like Jakarta Commons Codec is the library
you're looking for. See http://jakarta.apache.org/commons/codec/ .
Other implementations also exist.

For the other; see what you get with
http://www.google.com/search?q=java+%22unix+crypt%22

For the "unix crypt" support, if you're after something that fills the
same functionality (one-way password hashing), but do not require
compatibility with the Unix crypt() -hashes, I'd recommend hashing
the passwords with either MD5 os SHA1 instead of the old DES-based
crypt().
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
 
Sudsy





PostPosted: 2004-12-22 3:47:00 Top

java-programmer >> Encryption Kevin wrote:
> I am trying to re-write a Perl program in Java (don't ask why ;-)
>
> I am having problems finding Java equivalents for the Perl encode_base64,
> used for encoding files for transmission, and crypt, used for encrypting
> passwords, functions.
>
> Can anyone help me?
>
> There does seem to be some encryption support in Java but it isn't clear how
> to use it in place of the Perl functions mentioned.

Been there, done that, wrote an article which you can find here:
<http://www.sudsy.net/technology/pcrypto.html>
 
 
PaulRosovsky





PostPosted: 2005-1-15 3:32:00 Top

java-programmer >> Encryption Has anyone used any encryption products to secure data assets in a Flash-based
application?

We are running a Flash interface that uses ActionScript to call a third party
program (Northcode's SWF Studio) to access data assets stored on a CD-ROM or
DVD-ROM. We need the data assets stored on the CD/DVD-ROM to be encrypted.

We need the encrytion/decryption application to initially launch and then be
totally transparent to the end-use, who will access the assets through the
Flash interface.

Any help would be appreciated.

Thanks!

 
 
PaulRosovsky





PostPosted: 2005-1-15 3:34:00 Top

java-programmer >> Encryption Has anyone used any encryption products to secure data assets in a Flash-based
application?

We are running a Flash interface that uses ActionScript to call a third party
program (Northcode's SWF Studio) to access data assets stored on a CD-ROM or
DVD-ROM. We need the data assets stored on the CD/DVD-ROM to be encrypted.

We need the encrytion/decryption application to initially launch and then be
totally transparent to the end-use, who will access the assets through the
Flash interface.

Any help would be appreciated.

Thanks!