From 7a0020ef1b4000bfbd50ab7230d771f300a7cdbe Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sat, 30 Mar 2019 22:23:38 +0400 Subject: [PATCH 01/10] fixed number of arguments for encrypt2 encrypt2 function requires only one image input argument and two image output arguments. I guess "2" was a typo, fixed it. --- dithercrypt/dithercrypt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dithercrypt/dithercrypt.py b/dithercrypt/dithercrypt.py index bb81775..6a073d1 100755 --- a/dithercrypt/dithercrypt.py +++ b/dithercrypt/dithercrypt.py @@ -20,7 +20,7 @@ def save_img(img, fn): def encrypt2(img): shape = img.shape - + out1 = np.zeros(shape, dtype=np.uint8) out2 = np.zeros(shape, dtype=np.uint8) @@ -41,7 +41,7 @@ def steg2(clear1, clear2, secret): shape = clear1.shape if shape != clear2.shape or shape != secret.shape: raise TypeError('all three images must have the same shape') - + out1 = np.zeros(shape, dtype=np.uint8) out2 = np.zeros(shape, dtype=np.uint8) @@ -192,7 +192,7 @@ def encrypt4(img_ab, img_ac, img_ad, img_bc, img_bd, img_cd): return (out_a, out_b, out_c, out_d) commands = [ - ('encrypt2', 2, 2, encrypt2), + ('encrypt2', 1, 2, encrypt2), ('steg2', 3, 2, steg2), ('encrypt3', 3, 3, encrypt3), ('encrypt4', 6, 4, encrypt4), From 6e61ad6057cf6e5eb1be0fcafc8663b060455c10 Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sat, 30 Mar 2019 22:29:59 +0400 Subject: [PATCH 02/10] added example usage --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a20aeb..793658c 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,15 @@ gamma. To print the results, you'll need to use a program that will give pixelated output instead of trying to interpolate. +Example usage: +``` +python /path/to/dithercrypt.py encrypt2 /path/to/inputimage.jpg output1.jpg output2.jpg +``` + # Visual cryptography workshop This is a placeholder. It's very awkward to use right now. # License -MIT \ No newline at end of file +MIT From 7ea883a044ad377ecdf500603dbc208c084c1edb Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sat, 30 Mar 2019 22:42:20 +0400 Subject: [PATCH 03/10] grammar fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 793658c..1858fad 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ output is printed on transparency film and overlaid. The [dithercrypt program](dithercrypt/dithercrypt.py) supports four variants: -* "encrypt2" encrypts a single image into two output grids. Taken +* "encrypt2" encrypts single image into two output grids. Taken individually, the grids are random noise. If overlaid, the image is revealed. Black areas of the secret image will appear entirely black; white areas will be half black and half white; and gray areas will be more than half black and less than half white. -* "encrypt3" encrypts a three images into three output grids. Taken +* "encrypt3" encrypts three images into three output grids. Taken individually, the grids are random noise. If two grids are overlaid, one of the three input images will be revealed. Black areas of the secret image will appear entirely black; white areas From 190b1b4ab7f78a91b77ad7be8418cc5ead0d3216 Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sat, 30 Mar 2019 23:20:49 +0400 Subject: [PATCH 04/10] added gitignore --- .gitignore | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..24b4c5a --- /dev/null +++ b/.gitignore @@ -0,0 +1,67 @@ + +# Created by https://www.gitignore.io/api/c++,macos +# Edit at https://www.gitignore.io/?templates=c++,macos + +### C++ ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.gitignore.io/api/c++,macos From 0901594ec661a79adb6341285f87e4eb1147e210 Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sun, 31 Mar 2019 00:09:49 +0400 Subject: [PATCH 05/10] cleaning --- {masks => dithercrypt/masks}/make_masks.py | 0 {masks => dithercrypt/masks}/mask_left.html | 0 {masks => dithercrypt/masks}/mask_right.html | 0 .../masks}/rects_negative.svg | 0 .../masks}/rects_positive.svg | 0 index.php | 3 + website/css/index.css | 43 ++++++++ website/css/style.css | 103 ++++++++++++++++++ website/index.php | 2 + 9 files changed, 151 insertions(+) rename {masks => dithercrypt/masks}/make_masks.py (100%) rename {masks => dithercrypt/masks}/mask_left.html (100%) rename {masks => dithercrypt/masks}/mask_right.html (100%) rename {masks => dithercrypt/masks}/rects_negative.svg (100%) rename {masks => dithercrypt/masks}/rects_positive.svg (100%) create mode 100644 index.php create mode 100644 website/css/index.css create mode 100644 website/css/style.css create mode 100644 website/index.php diff --git a/masks/make_masks.py b/dithercrypt/masks/make_masks.py similarity index 100% rename from masks/make_masks.py rename to dithercrypt/masks/make_masks.py diff --git a/masks/mask_left.html b/dithercrypt/masks/mask_left.html similarity index 100% rename from masks/mask_left.html rename to dithercrypt/masks/mask_left.html diff --git a/masks/mask_right.html b/dithercrypt/masks/mask_right.html similarity index 100% rename from masks/mask_right.html rename to dithercrypt/masks/mask_right.html diff --git a/masks/rects_negative.svg b/dithercrypt/masks/rects_negative.svg similarity index 100% rename from masks/rects_negative.svg rename to dithercrypt/masks/rects_negative.svg diff --git a/masks/rects_positive.svg b/dithercrypt/masks/rects_positive.svg similarity index 100% rename from masks/rects_positive.svg rename to dithercrypt/masks/rects_positive.svg diff --git a/index.php b/index.php new file mode 100644 index 0000000..1377d9a --- /dev/null +++ b/index.php @@ -0,0 +1,3 @@ + diff --git a/website/css/index.css b/website/css/index.css new file mode 100644 index 0000000..4f6b235 --- /dev/null +++ b/website/css/index.css @@ -0,0 +1,43 @@ +body { + font-size: 11pt; + margin: 3em; + background: #fff; + color: #444; + max-width: 100%; + font-family: monospace; +} + +h1 { + text-transform: uppercase; + font-size: 1em; +} + +h2 { + font-size: 1em; + text-transform: uppercase; + margin-top: 1em; +} + +section a { + color: #444; + display: block; + margin: 0; +} + +a:hover { + color: #268bd2; +} + +.postdate { + color: #CCC; +} + +@media (max-width: 1080px) { + body { + margin: 3em; + font-size: 20pt; + } + a { + margin-top: 0.25em; + } +} diff --git a/website/css/style.css b/website/css/style.css new file mode 100644 index 0000000..bbfb669 --- /dev/null +++ b/website/css/style.css @@ -0,0 +1,103 @@ +body { + color: #000; + background: #FFF; + + max-width: 30em; + margin: 6em 3em 6em 6em; + + font-family: sans-serif; + font-style: normal; + font-size: 11pt; + line-height: 1.5; +} + +h1, h2, h3, h4 { + margin-bottom: 0; + padding-bottom: 0; + font-size: 1em; +} + +p { + margin-top: 0.5em; + margin-bottom: 0; + text-align: left; + hyphenate: auto; + hyphenate-before:2; + hyphenate-after:3; +} + +/* all paragraphs that are proceeded by another paragraph. tiny paragraphs don't + * count */ +p:not(.tiny) + p, figure + p { + margin-top: 0; + text-indent: 1.5em; +} + +p.tiny, #bottom { + margin-top: 1em; + 1argin-bottom: 1em; + text-indent: 0; + color: #CCC; +} + +img { + width: 100%; +} + +figcaption { + margin-top: 0.5em; +} + +figure { + margin: 1.5em 8em; + padding: 2em 0; + max-width: 600px; +} + +@media (max-width: 700px) { + figure { + margin: 1.5em 0; + } +} + +pre { + margin: 1em 2em; +} + +pre code { + background: none; + font-size: 1em; +} + +code { + background: rgba(0, 0, 0, 0.05); + padding: .2em; + font-size: .8em; +} + +a { + color: #268bd2; + text-decoration: none; +} + +a:hover { + color: #1a6192; +} + +#header, header { + float: left; + width: 100%; + line-height: 1.3; + padding-bottom: 4em; +} + +#header h1, header h1 { + padding: 50px 0 0 0; + margin: 0; +} + +#header h2, header h2 { + margin: 0; + color: #CCC; +} + diff --git a/website/index.php b/website/index.php new file mode 100644 index 0000000..acb6c35 --- /dev/null +++ b/website/index.php @@ -0,0 +1,2 @@ + From 3bbacebfa1e97ba4a2c4198e590c74d20781951d Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sun, 31 Mar 2019 00:30:49 +0400 Subject: [PATCH 06/10] test --- website/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/website/index.php b/website/index.php index acb6c35..dd54dbb 100644 --- a/website/index.php +++ b/website/index.php @@ -1,2 +1,3 @@ From 0358b265e675030e1636ecf9d58845dbf55ecdd0 Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sun, 31 Mar 2019 00:37:00 +0400 Subject: [PATCH 07/10] test2 --- website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.php b/website/index.php index dd54dbb..c13c253 100644 --- a/website/index.php +++ b/website/index.php @@ -1,3 +1,3 @@ From 9267e29eec0bb0009295b15a7fcbc4f8478710ea Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Sun, 31 Mar 2019 00:52:20 +0400 Subject: [PATCH 08/10] more tests --- website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.php b/website/index.php index c13c253..4f79513 100644 --- a/website/index.php +++ b/website/index.php @@ -1,3 +1,3 @@ From b53a1ab74ef48b72d3c218716aeef4eb828bc055 Mon Sep 17 00:00:00 2001 From: woswos Date: Sat, 30 Mar 2019 14:14:33 -0700 Subject: [PATCH 09/10] added html --- .cpanel.yml | 5 +++++ website/index.php | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .cpanel.yml diff --git a/.cpanel.yml b/.cpanel.yml new file mode 100644 index 0000000..f8be5e0 --- /dev/null +++ b/.cpanel.yml @@ -0,0 +1,5 @@ +--- +deployment: + tasks: + - export DEPLOYPATH=/home/bsimsekc/public_html/visual-cryptography + - /bin/cp -R * $DEPLOYPATH diff --git a/website/index.php b/website/index.php index 4f79513..510767c 100644 --- a/website/index.php +++ b/website/index.php @@ -1,3 +1,16 @@ + + + + + barkin | viusal cryptography + + + + + + + + From dacfa10e0860e7a5a4f02e68b07e3890939fd84c Mon Sep 17 00:00:00 2001 From: woswos Date: Sat, 30 Mar 2019 22:54:51 -0700 Subject: [PATCH 10/10] deleted cpanel file --- .cpanel.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .cpanel.yml diff --git a/.cpanel.yml b/.cpanel.yml deleted file mode 100644 index f8be5e0..0000000 --- a/.cpanel.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -deployment: - tasks: - - export DEPLOYPATH=/home/bsimsekc/public_html/visual-cryptography - - /bin/cp -R * $DEPLOYPATH