NEW: starting the skeleton of the app
This commit is contained in:
parent
4b23a4efa1
commit
c0e220a599
|
@ -0,0 +1,31 @@
|
|||
[[[ Picseal ]]]
|
||||
|
||||
[[ MVP Plan ]]
|
||||
|
||||
[ C ]
|
||||
libexiv --> exif read/write
|
||||
libwolfss --> crypto generation
|
||||
|
||||
|
||||
[ Functions ]
|
||||
# load image file
|
||||
picseal.init(image_file)
|
||||
|
||||
# create pub/priv key pair
|
||||
# add new public key to exif
|
||||
# store priv key in memory
|
||||
picseal.add_new_key(CIPHER_TYPE)
|
||||
|
||||
# hash the image, encrypt hash with priv-key
|
||||
# hash the image & specific exif tags, encrypt hash with priv-key
|
||||
# add signatures to exif
|
||||
picseal.seal_image(HASH_TYPE)
|
||||
|
||||
# write the image with public key, and signature
|
||||
picseal.write_pub(FILE_HANDLE)
|
||||
|
||||
|
||||
# write the image with private key, and signature
|
||||
# ADD PIN??
|
||||
picseal.write_priv(FILE_HANDLE)
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
Exif.Image.Make Ascii 6 Canon
|
||||
Exif.Image.Model Ascii 13 Canon EOS 6D
|
||||
Exif.Image.XResolution Rational 1 300
|
||||
Exif.Image.YResolution Rational 1 300
|
||||
Exif.Image.ResolutionUnit Short 1 inch
|
||||
Exif.Image.Software Ascii 43 Adobe Photoshop Camera Raw 9.5 (Macintosh)
|
||||
Exif.Image.DateTime Ascii 20 2016:07:18 04:42:31
|
||||
Exif.Image.ExifTag Long 1 222
|
||||
Exif.Photo.ExposureTime Rational 1 1/15 s
|
||||
Exif.Photo.FNumber Rational 1 F2.8
|
||||
Exif.Photo.ExposureProgram Short 1 Manual
|
||||
Exif.Photo.ISOSpeedRatings Short 1 800
|
||||
Exif.Photo.SensitivityType Short 1 2
|
||||
Exif.Photo.RecommendedExposureIndex Long 1 800
|
||||
Exif.Photo.ExifVersion Undefined 4 2.30
|
||||
Exif.Photo.DateTimeOriginal Ascii 20 2016:07:17 20:57:01
|
||||
Exif.Photo.DateTimeDigitized Ascii 20 2016:07:17 20:57:01
|
||||
Exif.Photo.ShutterSpeedValue SRational 1 1/15 s
|
||||
Exif.Photo.ApertureValue Rational 1 F2.8
|
||||
Exif.Photo.ExposureBiasValue SRational 1 0 EV
|
||||
Exif.Photo.MaxApertureValue Rational 1 F2.8
|
||||
Exif.Photo.MeteringMode Short 1 Multi-segment
|
||||
Exif.Photo.Flash Short 1 No, compulsory
|
||||
Exif.Photo.FocalLength Rational 1 14.0 mm
|
||||
Exif.Photo.SubSecTimeOriginal Ascii 3 13
|
||||
Exif.Photo.SubSecTimeDigitized Ascii 3 13
|
||||
Exif.Photo.ColorSpace Short 1 Uncalibrated
|
||||
Exif.Photo.FocalPlaneXResolution Rational 1 1520
|
||||
Exif.Photo.FocalPlaneYResolution Rational 1 1520
|
||||
Exif.Photo.FocalPlaneResolutionUnit Short 1 cm
|
||||
Exif.Photo.CustomRendered Short 1 Normal process
|
||||
Exif.Photo.ExposureMode Short 1 Manual
|
||||
Exif.Photo.WhiteBalance Short 1 Manual
|
||||
Exif.Photo.SceneCaptureType Short 1 Standard
|
||||
Exif.Photo.BodySerialNumber Ascii 13 422052001752
|
||||
Exif.Photo.LensSpecification Rational 4 14/1 14/1 0/0 0/0
|
||||
Exif.Photo.LensModel Ascii 5 14mm
|
||||
Exif.Photo.LensSerialNumber Ascii 11 0000000000
|
||||
Exif.Image.GPSTag Long 1 764
|
||||
Exif.GPSInfo.GPSVersionID Byte 4 2.3.0.0
|
||||
Exif.GPSInfo.GPSLatitudeRef Ascii 2 North
|
||||
Exif.GPSInfo.GPSLatitude Rational 3 28deg 29.17330'
|
||||
Exif.GPSInfo.GPSLongitudeRef Ascii 2 West
|
||||
Exif.GPSInfo.GPSLongitude Rational 3 80deg 32.60570'
|
||||
Exif.GPSInfo.GPSAltitudeRef Byte 1 Above sea level
|
||||
Exif.GPSInfo.GPSAltitude Rational 1 25.6 m
|
||||
Exif.GPSInfo.GPSTimeStamp Rational 3 04:56:53.0
|
||||
Exif.GPSInfo.GPSSatellites Ascii 3 11
|
||||
Exif.GPSInfo.GPSStatus Ascii 2 Measurement in progress
|
||||
Exif.GPSInfo.GPSMeasureMode Ascii 2 Three-dimensional measurement
|
||||
Exif.GPSInfo.GPSDOP Rational 1 500/10
|
||||
Exif.GPSInfo.GPSMapDatum Ascii 7 WGS-84
|
||||
Exif.GPSInfo.GPSDateStamp Ascii 11 2016:07:18
|
||||
Exif.Thumbnail.Compression Short 1 JPEG (old-style)
|
||||
Exif.Thumbnail.XResolution Rational 1 72
|
||||
Exif.Thumbnail.YResolution Rational 1 72
|
||||
Exif.Thumbnail.ResolutionUnit Short 1 inch
|
||||
Exif.Thumbnail.JPEGInterchangeFormat Long 1 1140
|
||||
Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 3794
|
||||
Iptc.Envelope.CharacterSet String 3 %G
|
||||
Iptc.Application2.RecordVersion Short 1 4
|
||||
Iptc.Application2.DateCreated Date 8 2016-07-17
|
||||
Iptc.Application2.TimeCreated Time 11 20:57:01+00:00
|
||||
Iptc.Application2.DigitizationDate Date 8 2016-07-17
|
||||
Iptc.Application2.DigitizationTime Time 11 20:57:01+00:00
|
||||
Xmp.xmp.ModifyDate XmpText 25 2016-07-18T04:42:31-04:00
|
||||
Xmp.xmp.CreateDate XmpText 22 2016-07-17T20:57:01.13
|
||||
Xmp.xmp.CreatorTool XmpText 42 Adobe Photoshop Camera Raw 9.5 (Macintosh)
|
||||
Xmp.xmp.MetadataDate XmpText 25 2016-07-18T04:42:31-04:00
|
||||
Xmp.aux.SerialNumber XmpText 12 422052001752
|
||||
Xmp.aux.LensInfo XmpText 17 14/1 14/1 0/0 0/0
|
||||
Xmp.aux.Lens XmpText 4 14mm
|
||||
Xmp.aux.LensID XmpText 3 103
|
||||
Xmp.aux.LensSerialNumber XmpText 10 0000000000
|
||||
Xmp.aux.ImageNumber XmpText 1 0
|
||||
Xmp.aux.FlashCompensation XmpText 3 0/1
|
||||
Xmp.aux.Firmware XmpText 5 1.1.6
|
||||
Xmp.photoshop.DateCreated XmpText 22 2016-07-17T20:57:01.13
|
||||
Xmp.xmpMM.DocumentID XmpText 44 xmp.did:fcba4f4f-fc67-4b11-9198-9013f6449440
|
||||
Xmp.xmpMM.OriginalDocumentID XmpText 32 79913BA83AD75143B10BADE9E67D02D4
|
||||
Xmp.xmpMM.InstanceID XmpText 44 xmp.iid:fcba4f4f-fc67-4b11-9198-9013f6449440
|
||||
Xmp.xmpMM.History XmpText 0 type="Seq"
|
||||
Xmp.xmpMM.History[1] XmpText 0 type="Struct"
|
||||
Xmp.xmpMM.History[1]/stEvt:action XmpText 7 derived
|
||||
Xmp.xmpMM.History[1]/stEvt:parameters XmpText 69 converted from image/x-canon-cr2 to image/jpeg, saved to new location
|
||||
Xmp.xmpMM.History[2] XmpText 0 type="Struct"
|
||||
Xmp.xmpMM.History[2]/stEvt:action XmpText 5 saved
|
||||
Xmp.xmpMM.History[2]/stEvt:instanceID XmpText 44 xmp.iid:fcba4f4f-fc67-4b11-9198-9013f6449440
|
||||
Xmp.xmpMM.History[2]/stEvt:when XmpText 25 2016-07-18T04:42:31-04:00
|
||||
Xmp.xmpMM.History[2]/stEvt:softwareAgent XmpText 42 Adobe Photoshop Camera Raw 9.5 (Macintosh)
|
||||
Xmp.xmpMM.History[2]/stEvt:changed XmpText 1 /
|
||||
Xmp.xmpMM.DerivedFrom XmpText 0 type="Struct"
|
||||
Xmp.xmpMM.DerivedFrom/stRef:documentID XmpText 32 79913BA83AD75143B10BADE9E67D02D4
|
||||
Xmp.xmpMM.DerivedFrom/stRef:originalDocumentID XmpText 32 79913BA83AD75143B10BADE9E67D02D4
|
||||
Xmp.dc.format XmpText 10 image/jpeg
|
||||
Xmp.crs.RawFileName XmpText 12 IMG_9367.CR2
|
||||
Xmp.crs.Version XmpText 3 9.5
|
||||
Xmp.crs.ProcessVersion XmpText 3 6.7
|
||||
Xmp.crs.WhiteBalance XmpText 7 As Shot
|
||||
Xmp.crs.AutoWhiteVersion XmpText 9 134348800
|
||||
Xmp.crs.Temperature XmpText 4 4000
|
||||
Xmp.crs.Tint XmpText 3 +33
|
||||
Xmp.crs.Saturation XmpText 1 0
|
||||
Xmp.crs.Sharpness XmpText 2 25
|
||||
Xmp.crs.LuminanceSmoothing XmpText 1 0
|
||||
Xmp.crs.ColorNoiseReduction XmpText 2 25
|
||||
Xmp.crs.VignetteAmount XmpText 1 0
|
||||
Xmp.crs.ShadowTint XmpText 1 0
|
||||
Xmp.crs.RedHue XmpText 1 0
|
||||
Xmp.crs.RedSaturation XmpText 1 0
|
||||
Xmp.crs.GreenHue XmpText 1 0
|
||||
Xmp.crs.GreenSaturation XmpText 1 0
|
||||
Xmp.crs.BlueHue XmpText 1 0
|
||||
Xmp.crs.BlueSaturation XmpText 1 0
|
||||
Xmp.crs.Vibrance XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentRed XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentOrange XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentYellow XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentGreen XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentAqua XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentBlue XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentPurple XmpText 1 0
|
||||
Xmp.crs.HueAdjustmentMagenta XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentRed XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentOrange XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentYellow XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentGreen XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentAqua XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentBlue XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentPurple XmpText 1 0
|
||||
Xmp.crs.SaturationAdjustmentMagenta XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentRed XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentOrange XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentYellow XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentGreen XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentAqua XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentBlue XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentPurple XmpText 1 0
|
||||
Xmp.crs.LuminanceAdjustmentMagenta XmpText 1 0
|
||||
Xmp.crs.SplitToningShadowHue XmpText 1 0
|
||||
Xmp.crs.SplitToningShadowSaturation XmpText 1 0
|
||||
Xmp.crs.SplitToningHighlightHue XmpText 1 0
|
||||
Xmp.crs.SplitToningHighlightSaturation XmpText 1 0
|
||||
Xmp.crs.SplitToningBalance XmpText 1 0
|
||||
Xmp.crs.ParametricShadows XmpText 1 0
|
||||
Xmp.crs.ParametricDarks XmpText 1 0
|
||||
Xmp.crs.ParametricLights XmpText 1 0
|
||||
Xmp.crs.ParametricHighlights XmpText 1 0
|
||||
Xmp.crs.ParametricShadowSplit XmpText 2 25
|
||||
Xmp.crs.ParametricMidtoneSplit XmpText 2 50
|
||||
Xmp.crs.ParametricHighlightSplit XmpText 2 75
|
||||
Xmp.crs.SharpenRadius XmpText 4 +1.0
|
||||
Xmp.crs.SharpenDetail XmpText 2 25
|
||||
Xmp.crs.SharpenEdgeMasking XmpText 1 0
|
||||
Xmp.crs.PostCropVignetteAmount XmpText 1 0
|
||||
Xmp.crs.GrainAmount XmpText 1 0
|
||||
Xmp.crs.ColorNoiseReductionDetail XmpText 2 50
|
||||
Xmp.crs.ColorNoiseReductionSmoothness XmpText 2 50
|
||||
Xmp.crs.LensProfileEnable XmpText 1 0
|
||||
Xmp.crs.LensManualDistortionAmount XmpText 1 0
|
||||
Xmp.crs.PerspectiveVertical XmpText 1 0
|
||||
Xmp.crs.PerspectiveHorizontal XmpText 1 0
|
||||
Xmp.crs.PerspectiveRotate XmpText 3 0.0
|
||||
Xmp.crs.PerspectiveScale XmpText 3 100
|
||||
Xmp.crs.PerspectiveAspect XmpText 1 0
|
||||
Xmp.crs.PerspectiveUpright XmpText 1 0
|
||||
Xmp.crs.AutoLateralCA XmpText 1 0
|
||||
Xmp.crs.Exposure2012 XmpText 4 0.00
|
||||
Xmp.crs.Contrast2012 XmpText 3 +20
|
||||
Xmp.crs.Highlights2012 XmpText 3 -50
|
||||
Xmp.crs.Shadows2012 XmpText 1 0
|
||||
Xmp.crs.Whites2012 XmpText 1 0
|
||||
Xmp.crs.Blacks2012 XmpText 1 0
|
||||
Xmp.crs.Clarity2012 XmpText 3 +20
|
||||
Xmp.crs.DefringePurpleAmount XmpText 1 0
|
||||
Xmp.crs.DefringePurpleHueLo XmpText 2 30
|
||||
Xmp.crs.DefringePurpleHueHi XmpText 2 70
|
||||
Xmp.crs.DefringeGreenAmount XmpText 1 0
|
||||
Xmp.crs.DefringeGreenHueLo XmpText 2 40
|
||||
Xmp.crs.DefringeGreenHueHi XmpText 2 60
|
||||
Xmp.crs.Dehaze XmpText 1 0
|
||||
Xmp.crs.ToneMapStrength XmpText 1 0
|
||||
Xmp.crs.ConvertToGrayscale XmpText 5 False
|
||||
Xmp.crs.ToneCurveName XmpText 15 Medium Contrast
|
||||
Xmp.crs.ToneCurveName2012 XmpText 6 Linear
|
||||
Xmp.crs.CameraProfile XmpText 14 Adobe Standard
|
||||
Xmp.crs.CameraProfileDigest XmpText 32 98BA1AFA1155D0472068BB57D3655975
|
||||
Xmp.crs.LensProfileSetup XmpText 12 LensDefaults
|
||||
Xmp.crs.HasSettings XmpText 4 True
|
||||
Xmp.crs.CropTop XmpText 7 0.09756
|
||||
Xmp.crs.CropLeft XmpText 8 0.087145
|
||||
Xmp.crs.CropBottom XmpText 8 0.921691
|
||||
Xmp.crs.CropRight XmpText 8 0.926215
|
||||
Xmp.crs.CropAngle XmpText 9 -0.473392
|
||||
Xmp.crs.CropConstrainToWarp XmpText 1 1
|
||||
Xmp.crs.CropWidth XmpText 1 2
|
||||
Xmp.crs.CropHeight XmpText 1 3
|
||||
Xmp.crs.CropUnit XmpText 1 3
|
||||
Xmp.crs.HasCrop XmpText 4 True
|
||||
Xmp.crs.AlreadyApplied XmpText 4 True
|
||||
Xmp.crs.ToneCurve XmpSeq 6 0, 0, 32, 22, 64, 56, 128, 128, 192, 196, 255, 255
|
||||
Xmp.crs.ToneCurveRed XmpSeq 2 0, 0, 255, 255
|
||||
Xmp.crs.ToneCurveGreen XmpSeq 2 0, 0, 255, 255
|
||||
Xmp.crs.ToneCurveBlue XmpSeq 2 0, 0, 255, 255
|
||||
Xmp.crs.ToneCurvePV2012 XmpSeq 2 0, 0, 255, 255
|
||||
Xmp.crs.ToneCurvePV2012Red XmpSeq 2 0, 0, 255, 255
|
||||
Xmp.crs.ToneCurvePV2012Green XmpSeq 2 0, 0, 255, 255
|
||||
Xmp.crs.ToneCurvePV2012Blue XmpSeq 2 0, 0, 255, 255
|
|
@ -0,0 +1,24 @@
|
|||
from gi.repository import GExiv2
|
||||
|
||||
exif = GExiv2.Metadata('space.jpg')
|
||||
|
||||
print("*** *** *** *** *** *** ***")
|
||||
print(exif)
|
||||
print(exif.get_date_time())
|
||||
print ("*** *** *** *** *** *** ***")
|
||||
|
||||
|
||||
# longitude, latitude, altitude
|
||||
#exif.set_gps_info(-79.3969702721, 43.6295057244, 76)
|
||||
|
||||
# Using dict notation like this reads/writes RAW string values
|
||||
# into the EXIF data, with no modification/interpolation by GExiv2.
|
||||
# Refer to GExiv2.py to see what kind of convenience methods are
|
||||
# supplied for setting/getting non-string values.
|
||||
#IPTC = 'Iptc.Application2.'
|
||||
#exif[IPTC + 'City'] = 'Toronto'
|
||||
#exif[IPTC + 'ProvinceState'] = 'Ontario'
|
||||
#exif[IPTC + 'CountryName'] = 'Canada'
|
||||
|
||||
#exif.save_file()
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
#
|
||||
#
|
||||
#
|
||||
import argparse
|
||||
|
||||
def main():
|
||||
parseArgs()
|
||||
|
||||
|
||||
def parseArgs():
|
||||
print '***** ***** ***** *****'
|
||||
print ' * Pic *** Seal *'
|
||||
print '***** ***** ***** *****\n'
|
||||
parser = argparse.ArgumentParser(description="Fingerprint a sqlite database based on its schema")
|
||||
parser.add_argument('-db', '--database', required=False, help="path to file to be fingerprinted")
|
||||
parser.add_argument('-fd', '--fpdir', required=False, help="path to directory of fingerprint files, compare each file")
|
||||
parser.add_argument('-fp', '--fingerprint', required=False, help="fingerprint file to use in comparison")
|
||||
parser.add_argument('-ad', '--android_dir', required=False, help="path to a directory with android folder structure sqlite files")
|
||||
parser.add_argument('-dd', '--data_dir', required=False, help="path to a directory to search for sqlite files")
|
||||
# parser.add_argument('-idx', '--index_fingerprints', required=False, help="path to a directory with sqlite files, index fingerprints if no other args given")
|
||||
parser.add_argument('-an', '--app_name', required=False)
|
||||
parser.add_argument('-av', '--app_version', required=False)
|
||||
parser.add_argument('-n', '--notes', required=False)
|
||||
parser.add_argument('-idx', action='store_true', help="add a fingerprint to the index")
|
||||
parser.add_argument('-md5', required=False, help="md5 hash to query the index`")
|
||||
parser.add_argument('-android_pull', action='store_true', help="automated pull of applications from a physical android phone")
|
||||
parser.add_argument('-v', '--verbose', action='store_true', help="will set logging level to INFO")
|
||||
parser.add_argument('-vv', '--vverbose', action='store_true', help="will set logging level to DEBUG")
|
||||
parser.add_argument('-l', '--logging', action='store_true', help="will supercede the -v option and send all logging to a file, logging.DEBUG")
|
||||
# parser.add_argument('-t', '--title', required=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
if (args.logging):
|
||||
logging.basicConfig(filename='dbfp.log', level=logging.DEBUG)
|
||||
|
||||
if (args.verbose):
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
elif (args.vverbose):
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
else:
|
||||
logging.basicConfig(level=logging.CRITICAL)
|
||||
|
||||
if args.fpdir and args.idx and (args.database or args.fingerprint):
|
||||
insertFP(args.database, args.fingerprint, args.fpdir)
|
||||
elif args.fpdir and args.idx:
|
||||
indexFingerprints(args.fpdir)
|
||||
elif (args.database and args.fingerprint):
|
||||
compareFingerprint(args.database, args.fingerprint)
|
||||
elif (args.fpdir and (args.database or args.fingerprint)):
|
||||
compareFPIndex(args.fpdir, args.database, args.fingerprint)
|
||||
elif (args.fpdir and args.md5):
|
||||
queryMD5(args.fpdir, args.md5)
|
||||
elif (args.android_dir):
|
||||
androidData(args.android_dir)
|
||||
elif (args.android_pull):
|
||||
androidPull()
|
||||
elif (args.database):
|
||||
createFingerprint(args.database, args.app_name, args.app_version, args.notes)
|
||||
else:
|
||||
print 'Create fingerprint:'
|
||||
print ' dbfp.py -db <database_file>\n'
|
||||
print 'Create fingerprint index:'
|
||||
print ' dbfp.py -fd <fingerprint_dir> -idx\n'
|
||||
print 'Add fingerprint to index:'
|
||||
print ' dbfp.py -fp <fingerprint_file> -idx (-db <database_file> | -fp <fingerprint_file>)\n'
|
||||
print 'Compare fingerprint to a database file:'
|
||||
print ' dbfp.py -fp <fingerprint_file> -db <database_file>\n'
|
||||
print 'Lookup fingerprint from index:'
|
||||
print ' dbfp.py -fd <fingerprint_dir> -fp <fingerprint_file>)\n'
|
||||
print 'Lookup database from index:'
|
||||
print ' dbfp.py -fd <fingerprint_dir> -db <database_file>\n'
|
||||
print 'Lookup MD5 hash from index:'
|
||||
print ' dbfp.py -fd <fingerprint_dir> -md5 <md5_hash_string>\n'
|
||||
print 'Android App pull and fingerprint:'
|
||||
print ' dbfp.py -android_pull'
|
||||
print '\n***** ***** ***** *****\n'
|
||||
parser.print_help()
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
print
|
Loading…
Reference in New Issue