15,664,273 members

# The Weird and The Wonderful

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 Re: Does anyone recognized this "decryption" algorithm? Philippe Verdy26-Nov-21 3:32 Philippe Verdy 26-Nov-21 3:32
 Re: Does anyone recognized this "decryption" algorithm? harold aptroot26-Nov-21 5:08 harold aptroot 26-Nov-21 5:08
 Re: Does anyone recognized this "decryption" algorithm? PIEBALDconsult26-Nov-21 10:00 PIEBALDconsult 26-Nov-21 10:00
 Re: Does anyone recognized this "decryption" algorithm? harold aptroot26-Nov-21 10:27 harold aptroot 26-Nov-21 10:27
 Re: Does anyone recognized this "decryption" algorithm? brian012528-Nov-21 16:53 brian0125 28-Nov-21 16:53
 Re: Does anyone recognized this "decryption" algorithm? Philippe Verdy8-Sep-22 20:14 Philippe Verdy 8-Sep-22 20:14
 Re: Does anyone recognized this "decryption" algorithm? harold aptroot9-Sep-22 1:01 harold aptroot 9-Sep-22 1:01
 Re: Does anyone recognized this "decryption" algorithm? Philippe Verdy9-Sep-22 1:31 Philippe Verdy 9-Sep-22 1:31
 A hash may be invertible if it contains at least as many bits as the input (though it is not is major usage where this is geenrally the reverse). But the arguments are the same: you just want a perfectly flattened distribution of bits in the result, and for using it as an encryption, you must ensure that there will NEVER be any collision (so the distribution is almost perfectly flattened with collision lists for each hash value being either 1 or 0, a property that a good hash algorithm should have as well when their input has the same (or smaller) bitsize as their output. But actually a good hash will want to have this flattened distribution even if you truncate the hash value to less bits (the same will be true if you use it as an invertible encryption that must be secure, i.e. where you cannot guess the decryption key if you konw some pairs of clear-text input and resulting "hash" value, which should still be invertible but only when you know the decryption key or when you can generate it easily because you know the encryption key). Many encryption algorothms also depend a the existence of a "securely strong" hash key (at least to generate the encryption/decryption keys), and the inversible operation of encrypting/decrypting may as well be used as a hashing function (once you give it one of the keys). Note that encrypting very short messages even with a very strong encryption algorithm with long keys causes a major problem because the result is no longer a flat distribution; that's why strong encryptions require padding those messages with enough bits so that they become longer than the minimum length required for the keys. Such padding are not random, but they cannot be static (e.g. all zeroes), but should be generated by a strong hash: very short messages will then become undistibuishable from long messages that have the desired flattened distribution of bits in their encrypted patterns.
 Re: Does anyone recognized this "decryption" algorithm? brian012528-Nov-21 16:54 brian0125 28-Nov-21 16:54
 Re: Does anyone recognized this "decryption" algorithm? Philippe Verdy8-Sep-22 20:37 Philippe Verdy 8-Sep-22 20:37
 Re: Does anyone recognized this "decryption" algorithm? brian012528-Nov-21 16:31 brian0125 28-Nov-21 16:31
 RA8875 has ridiculous registers honey the codewitch16-Nov-21 1:31 honey the codewitch 16-Nov-21 1:31
 Re: RA8875 has ridiculous registers Greg Utas16-Nov-21 1:39 Greg Utas 16-Nov-21 1:39
 Re: RA8875 has ridiculous registers honey the codewitch16-Nov-21 1:42 honey the codewitch 16-Nov-21 1:42
 Re: RA8875 has ridiculous registers Jörgen Andersson23-Nov-21 3:00 Jörgen Andersson 23-Nov-21 3:00
 Re: RA8875 has ridiculous registers den2k8816-Nov-21 1:45 den2k88 16-Nov-21 1:45
 Re: RA8875 has ridiculous registers honey the codewitch16-Nov-21 4:13 honey the codewitch 16-Nov-21 4:13
 Re: RA8875 has ridiculous registers PIEBALDconsult16-Nov-21 4:10 PIEBALDconsult 16-Nov-21 4:10
 Re: RA8875 has ridiculous registers honey the codewitch16-Nov-21 4:13 honey the codewitch 16-Nov-21 4:13
 Re: RA8875 has ridiculous registers Fueled By Decaff16-Nov-21 4:18 Fueled By Decaff 16-Nov-21 4:18
 Re: RA8875 has ridiculous registers honey the codewitch16-Nov-21 4:19 honey the codewitch 16-Nov-21 4:19
 Re: RA8875 has ridiculous registers Fueled By Decaff16-Nov-21 4:48 Fueled By Decaff 16-Nov-21 4:48
 Re: RA8875 has ridiculous registers honey the codewitch16-Nov-21 5:07 honey the codewitch 16-Nov-21 5:07
 Re: RA8875 has ridiculous registers Peter Adam25-Nov-21 20:51 Peter Adam 25-Nov-21 20:51
 Re: RA8875 has ridiculous registers honey the codewitch25-Nov-21 22:19 honey the codewitch 25-Nov-21 22:19
 Last Visit: 31-Dec-99 18:00     Last Update: 30-May-23 7:08 Refresh ᐊ Prev1...15161718192021222324 Next ᐅ