• Cary Howell
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
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?
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?
I'm having trouble using the Apex Data Loader from the command line.  It works fine thru the GUI.  If I encrypt just my password and run it, I get an "Invalid user name, password, or missing security token" error.  If I encrypt my password and my security token, I get the following error:
 
2008-08-15 15:46:53,476 INFO  [main] controller.Controller initLog (Controller.java:388) - The log has been initialized
2008-08-15 15:46:53,492 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:78) - Loading process configuration from config file: C:\Program Files\salesforce.com\Apex Data Loader 13.0\bin\..\conf\process-conf.xml
2008-08-15 15:46:53,538 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file [C:\Program Files\salesforce.com\Apex Data Loader 13.0\bin\..\conf\process-conf.xml]
2008-08-15 15:46:53,570 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:66) - JDK 1.4+ collections available
2008-08-15 15:46:53,585 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:71) - Commons Collections 3.x available
2008-08-15 15:46:53,648 INFO  [positionExtract] controller.Controller initConfig (Controller.java:343) - The controller config has been initialized
2008-08-15 15:46:53,648 INFO  [positionExtract] process.ProcessRunner run (ProcessRunner.java:102) - Initializing process engine
2008-08-15 15:46:53,663 INFO  [positionExtract] process.ProcessRunner run (ProcessRunner.java:105) - Loading parameters
2008-08-15 15:46:54,663 ERROR [positionExtract] config.Config decryptProperty (Config.java:642) - Error loading parameter: sfdc.password of type: java.lang.String
javax.crypto.BadPaddingException: Given final block not properly padded
 at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
 at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
 at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA12275)
 at javax.crypto.Cipher.doFinal(DashoA12275)
 at com.salesforce.lexiloader.security.EncryptionUtil.decryptString(EncryptionUtil.java:197)
 at com.salesforce.lexiloader.config.Config.decryptProperty(Config.java:636)
 at com.salesforce.lexiloader.config.Config.postLoad(Config.java:588)
 at com.salesforce.lexiloader.config.Config.loadParameterOverrides(Config.java:614)
 at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.java:106)
 at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.java:228)
2008-08-15 15:46:54,663 FATAL [positionExtract] process.ProcessRunner run (ProcessRunner.java:156) - Error loading parameter: sfdc.password of type: java.lang.String
 
 
It seems to be having a problem with the password but I'm not sure what it's trying to tell me.
 
 
 
I discovered what the problem was.  I did not have the password and security token encrypted properly. 
 
 


Message Edited by upsetstomach on 08-18-2008 01:43 PM