tai / decrypt-xyz3w

Decrypts newer *.3W format generated by XYZPrinting XYZware into zipped *.gcode (for daVinci 3D printer)
10 stars 3 forks source link

Decryption not working properly #1

Open PaulChristopher opened 7 years ago

PaulChristopher commented 7 years ago

System: Win10 Java: jdk1.8.0_121 Zip-Tool: 7-zip, standard built-in win zip

Thank you very much for writing and releasing this very useful tool! However it seems not to work anymore. I get the exception "Exception in thread "main" javax.crypto.BadPaddingException: Given final block not properly padded". According to this post on Stakeoverflow, I changed aes.doFinal to aes.update which helped to get rid off the error. However, I now cannot open the zip archive. The created archives are reported as corrupted. Can you please have a look at this? I consider your tool so useful and I am not a java expert.

mjf55 commented 7 years ago

I too am experiencing the same issue.
Hardware: Raspberry Pi OS: Raspbian Jessie (Debian) Kernel: Linux 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux Java: 1.8.0_65

I did the same steps as PaulChristopher trying to get a usable zip file. I used linux zip with the -F ( fix ) and -FF ( try harder to fix. ) but to no avail. The last one ( -FF) resulted in an empty zip file.

Please help by resolving this issue. This is really a great tool and has wide potential to understand the GCode generated by xyzprinting.

RiRomain commented 6 years ago

Same problem here with open-jdk 1.8.0_151 and this 3W file: 3DD_Spool_Clip_v3-0.zip (I only zipped the file so that github authorize the upload).

XYZware 2.1.27.3 with this STL file: 3DD_Spool_Clip_v3-0.stl.zip (again, zipped to allow upload)

root@abc:/mnt/c/decrypt-xyz3w-master# java DecryptXYZ3W 3DD_Spool_Clip_v3-0.3w out.zip Exception in thread "main" javax.crypto.BadPaddingException: Given final block not properly padded at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:991) at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:847) at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446) at javax.crypto.Cipher.doFinal(Cipher.java:2223) at DecryptXYZ3W.main(DecryptXYZ3W.java:51)

burgessr commented 5 years ago

I also get the same BadPaddingException with .3w files produced by my new daVinci Jr. 1.0w printer. After attempting to convert files using AWa's dV3wConverter code which fails with the error "Corrupted 3w file" I explored his code and the files produced by my printer and found that the file had the expected prefix of 0x2000 bytes but the following bytes were not structured as 0x2010 size chunks padded with 0x10 bytes at the end. Looks like xyzprinter folks have changed the 3w file structure.