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
6e51e735
Commit
6e51e735
authored
Dec 08, 2021
by
Floris Valentijn
Browse files
Delete client.py
parent
17d982c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
client.py
deleted
100644 → 0
View file @
17d982c9
import
socket
import
time
host
=
'local host'
port
=
5000
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
connect
((
'127.0.0.1'
,
port
))
# receive message
msg
=
s
.
recv
(
1024
)
result
=
[]
begin
=
time
.
time
()
decoded
=
""
# as long as the server does not send "end" keep receiving the message
# meanwhile extract the bits encoded in the timing channel
while
decoded
!=
"end"
:
decoded
=
msg
.
decode
()
print
(
'Received:'
+
decoded
)
msg
=
s
.
recv
(
1024
)
end
=
time
.
time
()
between
=
end
-
begin
print
(
between
)
if
between
>
0.05
:
result
.
append
(
"1"
)
else
:
result
.
append
(
"0"
)
begin
=
time
.
time
()
message
=
''
.
join
(
result
)
# convert the byte array to a message
i
=
0
test_list
=
[]
while
i
<
len
(
message
):
# Convert the byte string to a string of characters
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
=
""
)
# disconnect the client
s
.
close
()
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