Group Abstract Group Abstract

Message Boards Message Boards

3
|
6.9K Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Encode/Decode bug?

Posted 11 years ago

I was playing around with the Encode/Get functions - specifying a key, and found that an encoded package could be decoded with numerous other keys. The below code works on all encoded files that I have tried:

chars = CharacterRange["a", "z"];
keys = DeleteDuplicates[Flatten[Table [a <> b <> c, {a, chars} , {b, chars}, {c, chars}]]];
Map [If[Get[encoded, #] === $Failed, , Print[#]] &, keys];

The output is usually 4 3-character keys that can be used to decode the package. They vary depending on the key that was given for encoding. I have tried it for other combinations such as 4 characters, 2 characters + digit and it gives other possible keys. It also produces the error (in the messages window): INTERNAL SELF-TEST ERROR: FileNotify|c|305

I am using Mathematica 10 - can anyone replicate this?

POSTED BY: E B
3 Replies

Hi E B,

I am not quite sure what your code is doing as it is not running on my computer like that. I have modified it and I hope that it is doing wha you are trying to achieve:

chars = CharacterRange["a", "z"];
keys = DeleteDuplicates[Flatten[Table[a <> b <> c, {a, chars}, {b, chars}, {c, chars}]]];
Quiet[Map[If[Decrypt[#, encoded] === $Failed, , Print[#]] &, keys]];

It does run quite a while, but only returns the one string I used to encrypt the data. (I ran it on a three letter string.)

Cheers, Marco

PS: The funny thing is that when I used ParallelMap to accelerate it, the code did not work.

POSTED BY: Marco Thiel
Posted 11 years ago
POSTED BY: E B
POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard