Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Floris Valentijn
Covert-Channel-ANS-Group-11
Commits
af6c2cb9
Commit
af6c2cb9
authored
Dec 08, 2021
by
Floris Valentijn
Browse files
Upload New File
parent
809d2c45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Storage_channel/message_decoder.py
0 → 100644
View file @
af6c2cb9
from
PIL
import
Image
import
numpy
as
np
img
=
np
.
array
(
Image
.
open
(
'encoded_beemovie.png'
))
# Extract message out of the red color of the image
secret
=
[]
for
row
in
img
:
for
col
in
row
:
R
=
col
[
0
]
secret
.
append
(
format
(
R
,
'08b'
)[
-
1
])
message
=
''
.
join
(
secret
)
i
=
0
test_list
=
[]
# Convert the byte string to a string of characters
while
i
<
len
(
message
):
letter
=
chr
(
int
(
message
[
i
:
i
+
8
],
2
))
if
int
(
message
[
i
:
i
+
8
],
2
)
==
0
:
break
test_list
.
append
(
letter
)
i
+=
8
print
(
letter
,
end
=
""
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment