core icon indicating copy to clipboard operation
core copied to clipboard

Certain algorithms seem not to work on Windows 10

Open dschadow opened this issue 3 years ago • 3 comments

Issue reported by John E. via Cryptool.org contact mail: There seems to be a problem with the Windows 10 version of JCrytool. Basically it doesn't seem to work when using certain algorithms. The MX Linux 19 version seems to work just fine. For example, I encrypted the test file using Vigenere and emailed the encrypted file to myself. I then attempted to decrypt the file on two different computers. The computer running JCryptool in Linux decrypted it perfectly, the computer running Windows 10 was unable to decrypt it at all. I found that in playing with the JCryptool program on Windows 10, the Vigenere algorithm was unable to correctly decrypt many files it had just encrypted. Often times the first few characters of the message were decrypted correctly only to have the balance of the message become gibberish. No such problem was ever noted with the JCtyptool progrm running under Linux. Thinking that the Windows 10 program might have somehow gotten corrupted I reinstalled it several times but continued to see the same errors after the reinstall. Was planning to use this program in a Fall university class, but cannot do so if it doesn't work properly in Windows as half the class likely will windows computers. If they all were running Linux computers there would be no problem. John Egenolf If you would like to see for yourself here an example the encrypted message message and password follow, it was encrypted using "printable characters alphabet." Was able to decrypt this successfully on Linux but not on Windows. password: 1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019 message: e|z 9{!5 }}9a\ß#ölöß~6 tÖ Äw7Ä~|wF73j $1yzÜ9& |5ßx~#2väöy9zö 9s3vx#ß6 üwü$6!y$Ü9bYü)Ögö ~A3y@x?7r'6~ uö% üÜü|1äü8v|wÄ"uö|3#}{üy |5y!8 ß|Ä~2!{z9;QüxÜ"}$y~ü>4äuÖ%@0Äü7r"9t ß~"z~|5ü {4ö|2 Üy8zöuß$ö|#1 |zyü}|1y 7!~{4@TÜuÖ'ü{#;7ä{ä%@22Xüä7{ß" !Ü~ösÖyät4Öß~üw!|ü $7zßw3yxz{"}äÜyÄ~(9väüy {v}7zü9 Ü~2>Xö!ß$Ü0^'üßö z#93 Ö} 6ö~6 Ö{2äÜÖÜ$6ßÜtxB8S5wö s}|0yöä{}1ö 0$~z0 wüwvü{z4|~%ß)4öü0%}z0v 5'~öß3s 8uü2wätÄ) {"E5 {#%u}ä)r"ää 9ä!5xqä};>9fü~ä4~%2"y#Ö15 x{2ßwy~ÜÄÜüy8wÄu#ß5|wÜÄ1Ö~6#Ü}2ßö |zw =3Ü"2u!6 |ö$| {48S% Ü;H:@12^ üz3~ zÄ"~s$} Ä1Öß4Üus"äz~yC0 $| |2rÄt5z%%{äxÄÖy9^[#&ümäÄÄ8z$5u"sÜürrß|5Äü5%{x4y&ßw Ö#{4 ÖÄ|ß}6Ä}ÄÜB5!Äzux1|rä1w~2wxvz#$|}2 |y4"z{4Öx 2>az|ä?8A>W78^~Ä!9V ößuö$ß7G

dschadow avatar Jun 05 '21 10:06 dschadow

Mentioned in jcryptool/core because multiple algorithms seem to be affected. Since I don't have access to Windows I can't reproduce this issue.

dschadow avatar Jun 05 '21 10:06 dschadow

Hi, I was able to replicate this. Windows->Linux and Windows->Windows seems affected. Not only the "Printable ASCII" alphabet is affected. We'll try to solve the problem soon! It would be best next time, if we are to replicate a specific situation, to send the file as an actual file — the contact form and possibly the github tracker are prone to garble the text after the fact.

simlei avatar Jun 09 '21 07:06 simlei

With https://github.com/jcryptool/crypto/commit/ea8a5a0256a121d67f89e4981633742ad0330b69 I removed umlauts and line breaks from the "printable ASCII alphabet". Encrypting on Windows (Win 10) and decrypting on Linux (Ubuntu) was tested and worked fine.

In my opinion removing the umlauts and line breaks from the printable ascii alphabet is a good solution, because of three reasons:

  1. Umlauts are not contained in the ascii alphabet and line breaks are not printable. Thus, the alphabet name "printable ascii chars" was misleading.
  2. In the encryption and decryption process are many casts between bytes, strings and integers. Every cast is a possible source of error, because the datatypes may use different encodings and contain different chars. Only using chars with the same index in ASCII and UTF-8 avoids this problem, because the chars have the same index in both alphabets.
  3. Line breaks are handled different in Linux and Windows. This is a general problem when working on files with linux and windows. Removing line breaks from the alphabet solves this problem.

grthor avatar Jun 14 '21 09:06 grthor