/* */ .search { float: right; margin-top: -10px; position: relative; display: none; } /* Pop up fancy box for mute and ban */ #popUp { width: 400px; height: 300px; margin-top:4px; } #popUp #header { width: 100%; height: 75px; border-bottom: 1px solid #ccc; background: #ffffff; /* Old browsers */ background: -moz-linear-gradient(top, #ffffff 0%, #f9f9f9 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f9f9f9)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #ffffff 0%,#f9f9f9 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #ffffff 0%,#f9f9f9 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #ffffff 0%,#f9f9f9 100%); /* IE10+ */ background: linear-gradient(to bottom, #ffffff 0%,#f9f9f9 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 ); /* IE6-9 */ } #popUp #header span { font-size: 20px; margin: 28px 30px; color: #3E90B9; text-shadow: 0 1px 4px rgba(255, 255, 255, 0.7); display: inline-block; line-height: 1em; } #popUp #body { margin: 30px; margin-top:25px; font-size: 12px; } #popUp #okay-button { margin-top: 30px; background: -webkit-linear-gradient(top, #f6fdff 0%,#b8dcea 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #f6fdff 0%,#b8dcea 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #f6fdff 0%,#b8dcea 100%); /* IE10+ */ background: -moz-linear-gradient(center top , #f6fdff, #b8dcea) repeat scroll 0 0 transparent; background: linear-gradient(top, #f6fdff, #b8dcea) repeat scroll 0 0 transparent; background: -webkit-linear-gradient(top, #f6fdff, #b8dcea) repeat scroll 0 0 transparent; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6fdff', endColorstr='#b8dcea'); outline: 0; border: 1px solid #85c2e0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; color: #4990b4; cursor: pointer; display: inline-block; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 15px; padding: 5px 15px; position: relative; text-align: center; text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6); -webkit-box-shadow: 0px 1px 4px #eaeaea; -moz-box-shadow: 0px 1px 4px #eaeaea; box-shadow: 0px 1px 4px #eaeaea; vertical-align: center; text-decoration: none; } #verificationDialog { margin: 0; padding: 0; } #validate-header { width: 100%; height: 70px; border-bottom: 1px solid #E5E5E5; background-color: #F8F8F8; border-radius: 7px 7px 0 0; } #validate-header h1 { display: inline-block; line-height: 1em; font-family: Helvetica; margin: 0; padding: 26px 25px; color: #5EA1C3; font-size: 23px; font-weight: normal; text-shadow: 0px 2px 2px #DDD; } #validate-body { padding: 15px 25px; color: #333; } #validate-body span { display: block; font-family: Arial; font-size: 12px; color: #555; padding-bottom: 15px; } .resend { color: #777; font-family: Arial; font-size: 13px; } .resend:hover { color: #3E90B9; } #joinCommunityDialog { width: 650px; height: 445px; } #header { width: 100%; height: 75px; border-bottom: 1px solid #ccc; border-radius: 7px 7px 0 0; background: #ffffff; /* Old browsers */ background: -moz-linear-gradient(top, #ffffff 0%, #f9f9f9 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f9f9f9)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #ffffff 0%,#f9f9f9 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #ffffff 0%,#f9f9f9 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #ffffff 0%,#f9f9f9 100%); /* IE10+ */ background: linear-gradient(to bottom, #ffffff 0%,#f9f9f9 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 ); /* IE6-9 */ } #header span { font-size: 23px; font-family: Helvetica; margin: 28px 29px; color: #5EA1C3; text-shadow: 0 2px 2px #DDD; display: inline-block; line-height: 1em; } #agreement ol li { font-size: 12px; display: inline-block; padding-right: 5px; color: #73bbdd; min-width: 125px; } .tou-tabs { display: flex; margin: 15px 0px 4px 30px; } .tou-tabs li { margin-right: 10px } ol li span { color: #7c7c7c; font-size: 13px; font-family: Arial; } label { color: #666666; } .tab-text { position: absolute; margin-top: 11px; } .tab-num-box { color: #7c7c7c; background-color: #e2e2e2; width: 41px; height: 36px; text-align: center; margin-right: 8px; display:block; float:left; } .tab-num-text { padding: 0px; margin-left: 15px; margin-top: 11px; font-family: 'Museo500'; font-size: 19px; display:block; float:left; } .finished { border: 1px solid #d7edf5; margin-bottom: -1px; background-color: #f8f8f8; } .finished .tab-num-box { color: white; font-family: 'Museo300'; background-color: #c5e3f2; } .finished .tab-num-text { color: #5A9ABA; } .finished .tab-text { font-family: 'Arial'; font-weight: bold; color: #c4e2f2; font-size: 13px; } .active .tab-num-box { background-color: #73bbdd; width: 41px; height: 41px; box-shadow: 0px 0px 5px (0, 0, 0 0.35); } .active .tab-num-text { color: white; margin-top: 13px; margin-left: 16px; } .active .tab-text { font-family: Arial; font-weight: bold; color: #5A9ABA; margin-top: 13px; } .wolframIdTab { width: 275px; } .wolframIdTab .tab-text { padding: 0px; } .acceptTouTab { border: 1px solid #b7dbed; border-bottom: none; opacity: 1; background-color: #f7fdff; width: 291px; height: 41px; margin-bottom: -5px; } .panel { background-color: #f7fdff; border: 1px solid #b7dbed; margin: 0px 30px; } .panel .label { display: block; font-family: Arial; font-size: 12px; color: #555; margin: 5px 15px; } .sub-panel { border-top: 1px solid #B7DBED; background: #fff; padding: 20px; padding-left: 25px; } .sub-panel a { padding: 0px 15px; text-decoration: none; font-size: 12px; color: #3187a7; } .sub-panel a:hover { color: #0a6089; } input[type="submit"] { background: -moz-linear-gradient(center top , #f6fdff, #b8dcea) repeat scroll 0 0 transparent; background: linear-gradient(top, #f6fdff, #b8dcea) repeat scroll 0 0 transparent; background: -webkit-linear-gradient(top, #f6fdff, #b8dcea) repeat scroll 0 0 transparent; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6fdff', endColorstr='#b8dcea'); outline: 0; border: 1px solid #85c2e0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; color: #4990b4; cursor: pointer; display: inline-block; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 15px; padding: 5px 15px; position: relative; text-align: center; text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6); -webkit-box-shadow: 0px 1px 4px #eaeaea; -moz-box-shadow: 0px 1px 4px #eaeaea; box-shadow: 0px 1px 4px #eaeaea; vertical-align: center; text-decoration: none; } input[type="submit"]:hover { background: -moz-linear-gradient(center top , #f6fdff, #90cae1) repeat scroll 0 0 transparent; background: linear-gradient(top, #f6fdff, #90cae1) repeat scroll 0 0 transparent; background: -webkit-linear-gradient(top, #f6fdff, #90cae1) repeat scroll 0 0 transparent; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6fdff', endColorstr='#90cae1'); border: 1px solid #85c2e0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; color: #3e90b9; cursor: pointer; display: inline-block; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 15px; padding: 5px 15px; position: relative; text-align: center; text-shadow: 0 1px 4px rgba(255, 255, 255, 0.7); vertical-align: center; text-decoration: none; } .cancel-button { background: -moz-linear-gradient(center top , #f6fdff, #b8dcea) repeat scroll 0 0 transparent; background: linear-gradient(top, #f6fdff, #b8dcea) repeat scroll 0 0 transparent; background: -webkit-linear-gradient(top, #f6fdff, #b8dcea) repeat scroll 0 0 transparent; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6fdff', endColorstr='#b8dcea'); outline: 0; border: 1px solid #85c2e0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; color: #4990b4; cursor: pointer; display: inline-block; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 15px; padding: 5px 15px; position: relative; text-align: center; text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6); -webkit-box-shadow: 0px 1px 4px #eaeaea; -moz-box-shadow: 0px 1px 4px #eaeaea; box-shadow: 0px 1px 4px #eaeaea; vertical-align: center; text-decoration: none; } .cancel-button:hover { background: -moz-linear-gradient(center top , #f6fdff, #90cae1) repeat scroll 0 0 transparent; background: linear-gradient(top, #f6fdff, #90cae1) repeat scroll 0 0 transparent; background: -webkit-linear-gradient(top, #f6fdff, #90cae1) repeat scroll 0 0 transparent; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6fdff', endColorstr='#90cae1'); border: 1px solid #85c2e0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; color: #3e90b9; cursor: pointer; display: inline-block; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; line-height: 15px; padding: 5px 15px; position: relative; text-align: center; text-shadow: 0 1px 4px rgba(255, 255, 255, 0.7); vertical-align: center; text-decoration: none; } #join-text { padding: 25px; color: #555; font-size: 13px; font-family: 'Arial'; height: 160px; line-height: 18px; color: #777; } #join-text a { text-decoration: none; color: #3187a7; } #join-text a:hover { text-decoration: none; color: #0a6089; } #join-text span { display: block; padding-bottom: 15px; } #confirm-cancel-text { padding: 25px; color: #777; font-size: 13px; line-height: 18px; font-family: 'Arial'; height: 160px; } #confirm-cancel-text h1 { font-family: Museo500; font-size: 17px; color: #146F9D; margin: 0px; font-weight: normal; } #confirm-cancel-text span { display: block; padding-bottom: 5px; } #cancel-reg { cursor: pointer; }

Message Boards Message Boards

Answer (Unmark) Mark as an Answer
.root-post .like-component { align-items: center; } .root-post .like-button { margin-left: 10px; } WOLFRAM COMMUNITY 9 | 698 Views | 2 Replies | 10 Total Likes View groups... Follow this post Share Share this post: GROUPS: Staff Picks Image Processing Visual Arts Wolfram Language Challenges Computational Humanities Cryptography

Representing or encrypting text with Truchet tiling. Can we reverse or simplify the encryption?

Vitaliy Kaurov Vitaliy Kaurov Vitaliy Kaurov, WOLFRAM Research Posted 18 days ago .root-post .like-component { align-items: center; } .root-post .like-button { margin-left: 0; }

Representing or encrypting text with Truchet tiling - the visualization

Attachments: DOWNLOAD-DESKTOP...nb POSTED BY: Vitaliy Kaurov 2 Replies Sort By: .root-post .like-component { align-items: center; } .root-post .like-button { margin-left: 0; } 1 Henrik Schachner Henrik Schachner Henrik Schachner, Radiation Therapy Center, Weilheim, Germany Posted 12 days ago

Dear Vitaliy,

what a neat idea encrypting text with Truchet tiling! Or another expression for this might be "steganography". Here is my approach for reversing that process - it is a nice little task. I found that getting the correct partitions of the final image being the main problem: here I did not have any better idea than simply trying different partitions - not really clever, unfortunately. But it should work on other tilings of that kind as well.The full code:

ClearAll["Global`*"]
a = Characters[StringPadLeft[IntegerString[#, 2], 8, "0"]] & /@ ToCharacterCode["hello world"];
i = Binarize /@ Flatten[Table[{#, ColorNegate@#} &@ Rasterize[Graphics[Disk[#, 1/2] & /@ k, PlotRange -> {{0, 1}, {0, 1}}], ImageSize -> 
        100], {k, {{{0, 0}, {1, 1}}, {{0, 1}, {1, 0}}}}]];
rules = {{x_, y_} /; EvenQ[x + y] && a[[x, y]] == "0" :> 
    i[[4]], {x_, y_} /; EvenQ[x + y] && a[[x, y]] == "1" :> 
    i[[1]], {x_, y_} /; OddQ[x + y] && a[[x, y]] == "0" :> 
    i[[3]], {x_, y_} /; OddQ[x + y] && a[[x, y]] == "1" :> i[[2]]};
img = ImageAssemble[ReplacePart[a, rules]];

(*  above: Vitaliy's code -- below: my approach for decryption  *)

(* possible partitions in terms of numbers: *)
partitions = Flatten[Table[{px, py}, {py, 6, 12}, {px, 4, 10}], 1];
dims = ImageDimensions[img];
(* possible partitions in terms of pixels: *)
pixdims = dims/# & /@ partitions;
imgParts = Flatten[ImagePartition[img, #], 1] & /@ pixdims;
(* trying to find clusters of similar partitions: *)
clusters = FindClusters /@ imgParts;

(* helper function for similarity within a cluster: *)
similarity[scl_List] := Module[{prodimg, meanimg, prod, mean},
  prodimg = Times @@ scl;
  meanimg = Mean[scl];
  prod = Total@Flatten@ImageData[prodimg];
  mean = Total@Flatten@ImageData[meanimg];
  prod/mean
  ]

(* with the correct partition 4 clusters are expected: *)
indx = First /@ Position[Length /@ clusters, 4];
(* there might be more clusters of length 4,
    ... then the winning index is: *)
windx = indx[[First @ PositionLargest[Times @@@ Map[similarity, clusters[[indx]], {2}]]]];

(* now - knowing the correct partitions - doing the precedure backwards: *)

partedImg = ImagePartition[img, pixdims[[windx]]];
nf = FeatureNearest[MapIndexed[#1 -> First[#2] &, i]];
matrix0 = Map[First@*nf, partedImg, {2}];
FromCharacterCode@FromDigits[#, 2] & /@ MapIndexed[If[EvenQ@Total[#2], If[#1 == 4, 0, 1], If[#1 == 3, 0, 1]] &, matrix0, {2}]
POSTED BY: Henrik Schachner .root-post .like-component { align-items: center; } .root-post .like-button { margin-left: 0; } 0 Moderation Team Moderation Team Moderation Team, WOLFRAM Posted 18 days ago

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Reply to this discussion in reply to Community posts can be styled and formatted using the Markdown syntax. Tag limit exceeded Note: Only the first five people you tag will receive an email notification; the other tagged names will appear as links to their profiles. Reply Preview Attachments Remove or Discard

Group Abstract Group Abstract

Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use Feedback © 2024 Wolfram. All rights reserved.