Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
MIT
6 changes: 3 additions & 3 deletions dithercrypt/dithercrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
3 changes: 3 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
require_once("website/index.php")
?>
43 changes: 43 additions & 0 deletions website/css/index.css
Original file line number Diff line number Diff line change
@@ -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;
}
}
103 changes: 103 additions & 0 deletions website/css/style.css
Original file line number Diff line number Diff line change
@@ -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;
}

16 changes: 16 additions & 0 deletions website/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
echo "test";
?>


<html>
<head>
<title>barkin | viusal cryptography</title>
<meta charset="utf-8" />
<link href="css/style.css" rel="stylesheet">
<link href="css/index.css" rel="stylesheet">
</head>
<body>

</body>
</html>