function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Cary HowellCary Howell 

Data loader password encryption check is failing.

I am performing the following commands and the result is a Given final block not properly padded.
I am running the uber jar on Linux but I have tried the encrypt.bat file under Windows with the exact same result!

First generate the key from the word "test" and store it in the key.txt file

java -cp bin/dataloader-35.0.0-uber.jar com.salesforce.dataloader.security.EncryptionUtil -g test > key.txt

Take my clear text password 'MyPassword" and encrypt it using the key in the key.txt file
java -cp bin/dataloader-35.0.0-uber.jar com.salesforce.dataloader.security.EncryptionUtil -e MyPassword "key.txt"

Taking the result of the above line I pass the encrypted password and the key from above to the -v option; fails with error.
java -cp bin/dataloader-35.0.0-uber.jar com.salesforce.dataloader.security.EncryptionUtil -v [encrypted password] test
error: Given final block not properly padded

Now if I simply create an encripted password without a key.txt file and validate (-v) it, it says all is okay.
Decryption of encrypted value MATCHES the expected value

What might I be doing wrong?
Best Answer chosen by Cary Howell
Andy BoettcherAndy Boettcher
Have you seen this article?  http://www.jitendrazaa.com/blog/salesforce/tutorial-of-command-line-dataloader-salesforce/

All Answers

Andy BoettcherAndy Boettcher
If you follow these steps on a Windows box - does it still fail?

https://developer.salesforce.com/forums/?id=906F00000008zYoIAI
Cary HowellCary Howell
Yes it does.
From a Windows 7 box using the batch files. 

encrypt.bat -g test > key.txt
encrypt.bat -e MyPassword "key.txt"
encrypt.bat -v [encrypted password from prevous command] test

error: Given final block not properly padded.
Andy BoettcherAndy Boettcher
Have you seen this article?  http://www.jitendrazaa.com/blog/salesforce/tutorial-of-command-line-dataloader-salesforce/
This was selected as the best answer
Cary HowellCary Howell
I have read the article. Interestingly enough I implemented the security encryption, it fails with Given final block not properly padded, but when I use the encrypted password to push data to the sandbox - the password is accepted. I don't know what's going on, but since it is working for the job it was intended, I'm just going to say the validation on the encrypt.bat file is a bit hokey.