Encrypting Files

One Star

Encrypting Files

Hi,
I need to be able to encrypt files.
Is there a tFileEncrypt component I can download?
Is it possible to do with tSystem? If yes, how?
Let me know
Thanks.
Boris
Community Manager

Re: Encrypting Files

Hello
I have uploaded a component tGPGEncrypt on 4557.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Encrypting Files

Hi,
I downloaded the following component: tFilePGPEncrypt.
Specified the following:
source plaintext file: test.txt (just a test notepad file)
destination encrypted file: test_encrypt
Public Key: specified id_rsa.pub file.
I am getting the error below:
java.io.IOException: unknown object in stream: 51
at org.bouncycastle.openpgp.PGPObjectFactory.nextObject(Unknown Source)
at org.bouncycastle.openpgp.PGPPublicKeyRingCollection.<init>(Unknown Source)
at org.talend.pgp.PGPEncrypt.readPublicKeyFromCol(PGPEncrypt.java:84)
at org.talend.pgp.PGPEncrypt.encryptFile(PGPEncrypt.java:51)
at ebs.concur_ftp_0_1.Concur_ftp.tFileEncryptPGP_1Process(Concur_ftp.java:200)
at ebs.concur_ftp_0_1.Concur_ftp.runJobInTOS(Concur_ftp.java:376)
at ebs.concur_ftp_0_1.Concur_ftp.main(Concur_ftp.java:270)
Community Manager

Re: Encrypting Files

Hello
Where do you download tFilePGPEncrypt?Exchange?
Please try tGPGEncrypt component.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Encrypting Files

Yes, from Exchange. Josh Holman, from Talend, actually told me to use tFileEncryptPGP component.
Six Stars

Re: Encrypting Files

tFileEncryptPGP is a pure Java implementation, the tGPGEncrypt requires a gpg/pgp binary. The problem is BouncyCastle does not recognize your key. id_rsa.pub is a SSH key. SSH keys are base64 encoded to be human readable. Try using GPG or PGP to generate your key.
EDIT:
Also, make sure you install the JCE Unlimited Strength Jurisdiction Policy Files.
One Star

Re: Encrypting Files

Hi,
I installed JCE Unlimited Strength Jurisdiction Policy Files, and also created a new key, which I am able to use to encrypt files manually. However, when I do it with tFileEncryptPGP component, and specify source file, destination file and key, it still produces the same error.
Please let me know,
Thanks
Boris
Six Stars

Re: Encrypting Files

The security files need to be installed into the Java version you are using.
The error:
java.security.InvalidKeyException: Illegal key size or default parameters
Is coming from your java.security which is in your core JVM, the jvm security policies are most likely not installed correctly. Make sure they policies are in /lib/security of the correct JVM
One Star

Re: Encrypting Files

I got this component to work. thanks.
Is tPGPEncrypt only usable on a windows box?
I need to be able to encrypt a file sitting on a UNIX box. There is no tFileGPGEncrypt component,right? How can I do that?
One Star

Re: Encrypting Files

Does this component only work if the gpg key created is RSA???
When I create a DSA type key, I get an error below when I try to encrypt a file. When I create an RSA key, then everything works fine.
Please let me know,
Thanks,
Boris
java.lang.NullPointerException
at org.talend.pgp.PGPEncrypt.encryptFile(PGPEncrypt.java:55)
at ebs.concur_ftp_0_1.Concur_ftp.tFileInputDelimited_1Process(Concur_ftp.java:248)
at ebs.concur_ftp_0_1.Concur_ftp.runJobInTOS(Concur_ftp.java:447)
at ebs.concur_ftp_0_1.Concur_ftp.main(Concur_ftp.java:341)
java.lang.NullPointerException
at org.talend.pgp.PGPEncrypt.encryptFile(PGPEncrypt.java:55)
at ebs.concur_ftp_0_1.Concur_ftp.tFileInputDelimited_1Process(Concur_ftp.java:248)
at ebs.concur_ftp_0_1.Concur_ftp.runJobInTOS(Concur_ftp.java:447)
at ebs.concur_ftp_0_1.Concur_ftp.main(Concur_ftp.java:341)
java.lang.NullPointerException
at org.talend.pgp.PGPEncrypt.encryptFile(PGPEncrypt.java:55)
at ebs.concur_ftp_0_1.Concur_ftp.tFileInputDelimited_1Process(Concur_ftp.java:248)
at ebs.concur_ftp_0_1.Concur_ftp.runJobInTOS(Concur_ftp.java:447)
at ebs.concur_ftp_0_1.Concur_ftp.main(Concur_ftp.java:341)
java.lang.NullPointerException
at org.talend.pgp.PGPEncrypt.encryptFile(PGPEncrypt.java:55)
at ebs.concur_ftp_0_1.Concur_ftp.tFileInputDelimited_1Process(Concur_ftp.java:248)
at ebs.concur_ftp_0_1.Concur_ftp.runJobInTOS(Concur_ftp.java:447)
at ebs.concur_ftp_0_1.Concur_ftp.main(Concur_ftp.java:341)
disconnected
java.lang.NullPointerException
at org.talend.pgp.PGPEncrypt.encryptFile(PGPEncrypt.java:55)
at ebs.concur_ftp_0_1.Concur_ftp.tFileInputDelimited_1Process(Concur_ftp.java:248)
at ebs.concur_ftp_0_1.Concur_ftp.runJobInTOS(Concur_ftp.java:447)
at ebs.concur_ftp_0_1.Concur_ftp.main(Concur_ftp.java:341)
java.lang.NullPointerException
at org.talend.pgp.PGPEncrypt.encryptFile(PGPEncrypt.java:55)
at ebs.concur_ftp_0_1.Concur_ftp.tFileInputDelimited_1Process(Concur_ftp.java:248)
at ebs.concur_ftp_0_1.Concur_ftp.runJobInTOS(Concur_ftp.java:447)
at ebs.concur_ftp_0_1.Concur_ftp.main(Concur_ftp.java:341)
Six Stars

Re: Encrypting Files

Hi Boris,
I can't remember if I left the drop down with DSA in the component or not, if I did I apologize. DSA is Digital Signature Algorithm and is used for signing only, not encrypting. I orginally intended to implement encryption with ElGamal and signing with DSA (Which PGP supports) but decided against it in the end and just used RSA, due to the collision weakness in SHA1 (used by DSA) and the GPG developers decision to move to RSA as the default (probably for this same reason). (http://lists.gnupg.org/pipermail/gnupg-users/2009-June/036794.html)

Josh
One Star

Re: Encrypting Files

Hi,
So, my client's requirement is that this is done with DSA type key, so tPGPEncrypt won't work for me.
I am now trying this using tSystem component. I put in this command (which works manually from a unix window):
"gpg --encrypt --recipient 'Boris Volf' /apps/talend/TIS_EE_3/share/EBS/list_p0005664dyoy_201005111441.txt"
And get the following:
Starting job Concur_ftp at 14:39 13/05/2010.
connecting to socket on port 4157
connected
disconnected
usage: gpg --encrypt
Job Concur_ftp ended at 14:39 13/05/2010.

This looks like 'Boris Volf' is causing issues due to single quotes inside double quotes. I tried with this, and still get the same:
"gpg --encrypt --recipient \'Boris Volf\' /apps/talend/TIS_EE_3/share/EBS/list_p0005664dyoy_201005111441.txt"
Do you know what the problem is?
Six Stars

Re: Encrypting Files

You are using a DSA/Elgamal keypair then. Trying passing the parameters in the parameters section of the tSystem instead of in the command section (which should just be '/usr/bin/gpg' or wherever gpg is)
One Star

Re: Encrypting Files

Yes, I am using DSA/Elgamal pair.
I created a parameter called "key_name", "key_name" values is "Boris Volf"
so my tSystem command looks like this:
"gpg --encrypt --recipient key_name /apps/talend/TIS_EE_3/share/EBS/list_p0005664dyoy_201005111441.txt"
However, now it does not recognize my public key:
connecting to socket on port 3391
connected
disconnected
gpg: key_name: skipped: public key not found
gpg: /apps/talend/TIS_EE_3/share/EBS/list_p0005664dyoy_201005111441.txt: encryption failed: public key not found
One Star

Re: Encrypting Files

Hi Josh,
Also, while generating a gpg key, I changed my name from "Boris Volf" to BorisVolf, eliminating the space.
From UNIX, this command still works:
gpg --encrypt --recipient 'BorisVolf' /apps/talend/TIS_EE_3/share/EBS/list_p0005664dyoy_201005111441.txt
From Talend, I get the "public key" not found error.
Please let me know how I can encrypt a file using any of Talend's components.
Thanks,
Boris
One Star

Re: Encrypting Files

Hello,
I removed the single quotes all together, and that seemed to have worked.
"gpg --encrypt --recipient BorisVolf /apps/talend/TIS_EE_3/share/EBS/list_p0005664dyoy_201005111441.txt"
Just waiting for my client to make sure DSA/Elgamal will work for them
Thanks,
Boris
One Star

Re: Encrypting Files

Hi
I have downloaded the "tGPGEncrypt" component from the following link:
http://www.talendforge.org/bugs/view.php?id=4557
However, when I use it to encrypt a file, nothing happens. It shows no error and exits with a return code 0.
--------------------------------------------------
Starting job tJava_cmd at 16:19 22/01/2011.
connecting to socket on port 3949
connected
disconnected
Job tJava_cmd ended at 16:19 22/01/2011.
----------------------------------------------------
Can you please advise..
Regards
Kshitij
One Star

Re: Encrypting Files

Is there any way I can use tGPGEncrypt to encrypt and sign a file? Please help.
One Star

Re: Encrypting Files

Hi,

I need to encrypt a csv file to a pgp file. And then again decrypt it....
please can you illustrate the steps with some example....
Also my version of talend studio does not have any encryption component...
please help asap...

thanks in advance...
One Star

Re: Encrypting Files

please help...I am new to talend