コード例 #1
0
ファイル: pksig_case2.py プロジェクト: JHUISI/auto-tools
def main():   
    groupObj = PairingGroup('/Users/matt/Documents/charm/param/d224.param')
    hess = Hess(groupObj)
    chch = CHCH(groupObj)
   
    (mpk, msk) = chch.setup()

    _id = "*****@*****.**"
    (pk, sk) = chch.keygen(msk, _id)
    if debug:  
        print("Keygen...")
        print("pk =>", pk)
        print("sk =>", sk)
 
    M = "this is a message! twice!" 
    sig1 = hess.sign(mpk, sk, M)
    sig2 = chch.sign(pk, sk, M)
    sig = { 'sig_hess':sig1, 'sig_chch':sig2 }
    if debug:
        print("Signature...")
        print("sig1 =>", sig1)
        print("sig2 =>", sig2)
   
    assert verify(mpk, pk, M, sig, hess, chch), "invalid signature!"
    if debug: print("Verification successful!")
コード例 #2
0
ファイル: pksig_case2.py プロジェクト: vusirikala/auto-tools
def main():
    groupObj = PairingGroup('/Users/matt/Documents/charm/param/d224.param')
    hess = Hess(groupObj)
    chch = CHCH(groupObj)

    (mpk, msk) = chch.setup()

    _id = "*****@*****.**"
    (pk, sk) = chch.keygen(msk, _id)
    if debug:
        print("Keygen...")
        print("pk =>", pk)
        print("sk =>", sk)

    M = "this is a message! twice!"
    sig1 = hess.sign(mpk, sk, M)
    sig2 = chch.sign(pk, sk, M)
    sig = {'sig_hess': sig1, 'sig_chch': sig2}
    if debug:
        print("Signature...")
        print("sig1 =>", sig1)
        print("sig2 =>", sig2)

    assert verify(mpk, pk, M, sig, hess, chch), "invalid signature!"
    if debug: print("Verification successful!")
コード例 #3
0
ファイル: pksig_case21.py プロジェクト: vusirikala/auto-tools
def main():
    #if ( (len(sys.argv) != 7) or (sys.argv[1] == "-help") or (sys.argv[1] == "--help") ):
    #sys.exit("Usage:  python " + sys.argv[0] + " [# of valid messages] [# of invalid messages] [size of each message] [prefix name of each message] [name of valid output dictionary] [name of invalid output dictionary]")

    groupObj = PairingGroup(MNT160)
    hess = Hess(groupObj)
    chch = CHCH(groupObj)
    combo = ComboScheme(groupObj)

    (mpk, msk) = chch.setup()

    _id = "*****@*****.**"
    (pk, sk) = chch.keygen(msk, _id)

    M = "this is a message! twice!"
    sig1 = hess.sign(mpk, sk, M)
    sig2 = chch.sign(pk, sk, M)
    sig = {'sig_hess': sig1, 'sig_chch': sig2}

    result = combo.verify(mpk, pk, M, sig)
    '''
コード例 #4
0
ファイル: pksig_case21.py プロジェクト: JHUISI/auto-tools
def main():
    #if ( (len(sys.argv) != 7) or (sys.argv[1] == "-help") or (sys.argv[1] == "--help") ):
        #sys.exit("Usage:  python " + sys.argv[0] + " [# of valid messages] [# of invalid messages] [size of each message] [prefix name of each message] [name of valid output dictionary] [name of invalid output dictionary]")
   
    groupObj = PairingGroup(MNT160)
    hess = Hess(groupObj)
    chch = CHCH(groupObj)
    combo = ComboScheme(groupObj)
   
    (mpk, msk) = chch.setup()

    _id = "*****@*****.**"
    (pk, sk) = chch.keygen(msk, _id)
 
    M = "this is a message! twice!" 
    sig1 = hess.sign(mpk, sk, M)
    sig2 = chch.sign(pk, sk, M)
    sig = { 'sig_hess':sig1, 'sig_chch':sig2 }
   
    result = combo.verify(mpk, pk, M, sig)

    '''