MOD: moving away from Exiv2, and towards my own binary code
This commit is contained in:
parent
f054bd2d0c
commit
9b9df9482e
|
@ -12,11 +12,15 @@
|
||||||
3) Digital Signature
|
3) Digital Signature
|
||||||
a. generate new public keys
|
a. generate new public keys
|
||||||
b. sign hash data with priv key
|
b. sign hash data with priv key
|
||||||
4) Write new PicSeal file
|
4) Write new PicSeal Public file
|
||||||
a. write encrypted original metadata
|
a. write encrypted original metadata
|
||||||
b. write PicSeal metadata
|
b. write PicSeal metadata
|
||||||
i. write JSON
|
i. write JSON
|
||||||
b. write image data
|
b. write image data
|
||||||
|
5) Write new PicSeal Private file
|
||||||
|
a. create thumbnail (smaller files)
|
||||||
|
b. write PicSeal metadata (JSON)
|
||||||
|
c. write image data
|
||||||
|
|
||||||
|
|
||||||
[[ PicSeal Metadata ]]
|
[[ PicSeal Metadata ]]
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#
|
#
|
||||||
|
# DEPRECATED
|
||||||
#
|
#
|
||||||
#
|
# ditching this for my own custom code
|
||||||
|
# uses GExiv2, and the C to Python bindings. but pain in the ass to install and config
|
||||||
|
# very limited read/wriging...cannot create a new application comment block. writing my own
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
import gi
|
import gi
|
||||||
|
|
17
picseal.py
17
picseal.py
|
@ -7,7 +7,6 @@ import logging
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
#from subprocess import Popen, PIPE, check_call
|
#from subprocess import Popen, PIPE, check_call
|
||||||
from libs.crypto_pub import Signature
|
from libs.crypto_pub import Signature
|
||||||
from libs.img_exif import ImgExif
|
|
||||||
from libs.toolbox import Toolbox
|
from libs.toolbox import Toolbox
|
||||||
from libs.jpg_tools import JpgTools
|
from libs.jpg_tools import JpgTools
|
||||||
|
|
||||||
|
@ -34,17 +33,19 @@ def processImage(image_fn):
|
||||||
|
|
||||||
# add a digital signature to the metadata
|
# add a digital signature to the metadata
|
||||||
def writePubImg(pub_fn, sig):
|
def writePubImg(pub_fn, sig):
|
||||||
img = ImgExif(pub_fn)
|
pass
|
||||||
img.addKey(sig.getPubKeyPEM())
|
# img = ImgExif(pub_fn)
|
||||||
img.addSig(sig.sig_data)
|
# img.addKey(sig.getPubKeyPEM())
|
||||||
img.saveFile()
|
# img.addSig(sig.sig_data)
|
||||||
|
# img.saveFile()
|
||||||
|
|
||||||
#
|
#
|
||||||
def writePrivImg(priv_fn, sig):
|
def writePrivImg(priv_fn, sig):
|
||||||
img = ImgExif(priv_fn)
|
pass
|
||||||
img.addKey(sig.getPrivKeyPEM())
|
# img = ImgExif(priv_fn)
|
||||||
|
# img.addKey(sig.getPrivKeyPEM())
|
||||||
#img.addSig(sig.sig_data)
|
#img.addSig(sig.sig_data)
|
||||||
img.saveFile()
|
# img.saveFile()
|
||||||
|
|
||||||
#
|
#
|
||||||
def copyImage(image_fn):
|
def copyImage(image_fn):
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Pillow==3.3.1
|
Pillow==3.3.1
|
||||||
pycrypto==2.6.1
|
pycrypto==2.6.1
|
||||||
pygobject==3.20.1
|
|
||||||
requests==2.11.0
|
requests==2.11.0
|
||||||
shellescape==3.4.1
|
shellescape==3.4.1
|
||||||
|
|
Loading…
Reference in New Issue