updating
This commit is contained in:
@@ -17,7 +17,7 @@ from base64 import b64decode, b64encode
|
|||||||
|
|
||||||
# global vars
|
# global vars
|
||||||
location = "/home/pi/final/videos/" # location of video files, subfolders "plaintext" and "encrypted" assumed to exist
|
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
|
# helps with video recording
|
||||||
def handler(s, f):
|
def handler(s, f):
|
||||||
@@ -61,7 +61,7 @@ def encryptVideo(file):
|
|||||||
with open(location+"encrypted/" + numFiles() + ".mpc", "wb") as encf:
|
with open(location+"encrypted/" + numFiles() + ".mpc", "wb") as encf:
|
||||||
encf.write(enc)
|
encf.write(enc)
|
||||||
# save the key
|
# 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))
|
keyf.write(encryptPGP(key))
|
||||||
|
|
||||||
# record the video and store in file location
|
# record the video and store in file location
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ host = '10.25.10.18' # IP of server that will recieve, not this device
|
|||||||
port = 12352
|
port = 12352
|
||||||
|
|
||||||
location = "/home/pi/final/"
|
location = "/home/pi/final/"
|
||||||
vidset = [file for file in glob.glob(location + "videos/encrypted/*", recursive=False)]
|
vidset = [file for file in glob.glob(location + "videos/encrypted/*.mpc", recursive=False)]
|
||||||
keyset = [file for file in glob.glob(location + "keys/*", recursive=False)]
|
keyset = [file for file in glob.glob(location + "keys/*.asc", recursive=False)]
|
||||||
if len(vidset) != len(keyset):
|
if len(vidset) != len(keyset):
|
||||||
print("Video and keyfiles are not properly matched")
|
print("Video and keyfiles are not properly matched")
|
||||||
exit()
|
exit()
|
||||||
|
|||||||
Reference in New Issue
Block a user