This commit is contained in:
Luke Ogburn
2021-03-04 20:20:33 -05:00
parent 237bd596dc
commit bdad3aca1e
3 changed files with 5 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ from base64 import b64decode, b64encode
# global vars
location = "/home/pi/final/videos/" # location of video files, subfolders "plaintext" and "encrypted" assumed to exist
seconds = 3 # seconds to record video for
seconds = int(open("interval", "r").read()) # seconds to record video for
# helps with video recording
def handler(s, f):
@@ -61,7 +61,7 @@ def encryptVideo(file):
with open(location+"encrypted/" + numFiles() + ".mpc", "wb") as encf:
encf.write(enc)
# save the key
with open("keys/" + numFiles() + ".asc", "wb") as keyf:
with open("keys/" + str(int(numFiles()) - 1) + ".asc", "wb") as keyf:
keyf.write(encryptPGP(key))
# record the video and store in file location

1
interval Normal file
View File

@@ -0,0 +1 @@
3

View File

@@ -20,8 +20,8 @@ host = '10.25.10.18' # IP of server that will recieve, not this device
port = 12352
location = "/home/pi/final/"
vidset = [file for file in glob.glob(location + "videos/encrypted/*", recursive=False)]
keyset = [file for file in glob.glob(location + "keys/*", recursive=False)]
vidset = [file for file in glob.glob(location + "videos/encrypted/*.mpc", recursive=False)]
keyset = [file for file in glob.glob(location + "keys/*.asc", recursive=False)]
if len(vidset) != len(keyset):
print("Video and keyfiles are not properly matched")
exit()