Example #1
0
 def addMember(self):
     msg1 = groupsig.join_mgr(0, self.isskey, self.grpkey)
     msg2 = groupsig.join_mem(1, self.grpkey, msgin=msg1)
     usk = msg2['memkey']
     msg3 = groupsig.join_mgr(2, self.isskey, self.grpkey, msg2['msgout'])
     msg4 = groupsig.join_mem(3, self.grpkey, msgin=msg3, memkey=usk)
     self.memkey = msg4['memkey']
Example #2
0
 def addMember(self):
     msg1 = groupsig.join_mgr(0, self.isskey, self.grpkey, gml = self.gml)
     msg2 = groupsig.join_mem(1, self.grpkey, msgin = msg1)
     usk = msg2['memkey']
     msg3 = groupsig.join_mgr(2, self.isskey, self.grpkey, msg2['msgout'], gml = self.gml)
     msg4 = groupsig.join_mem(3, self.grpkey, msgin = msg3, memkey = usk)
     usk = msg4['memkey']
     self.memkeys.append(usk)
Example #3
0
 def addMember(self):
     msg1 = groupsig.join_mgr(0, self.mgrkey, self.grpkey, gml=self.gml)
     msg2 = groupsig.join_mem(1, self.grpkey, msgin=msg1)
     usk = msg2['memkey']
     self.memkeys.append(usk)
Example #4
0
from pygroupsig import memkey
from pygroupsig import grpkey
from pygroupsig import mgrkey
from pygroupsig import constants

# Setup
issuer = groupsig.setup(constants.GL19_CODE)
_gpk = issuer['grpkey']
isk = issuer['mgrkey']
converter = groupsig.setup(constants.GL19_CODE, _gpk)
csk = converter['mgrkey']
gpk = converter['grpkey']

# Join
msg1 = groupsig.join_mgr(0, isk, gpk)
msg2 = groupsig.join_mem(1, gpk, msgin=msg1)
usk = msg2['memkey']
msg3 = groupsig.join_mgr(2, isk, gpk, msg2['msgout'])
msg4 = groupsig.join_mem(3, gpk, msgin=msg3, memkey=usk)
usk = msg4['memkey']

# Sign
sig = groupsig.sign("Hello, World!", usk, gpk)

# Verify
b = groupsig.verify(sig, "Hello, World!", gpk)

if b == True:
    print("VALID signature.")
else:
    print("WRONG signature.")
Example #5
0
#!/usr/bin/env python3

import sys

from pygroupsig import groupsig
from pygroupsig import memkey
from pygroupsig import grpkey
from pygroupsig import message
from pygroupsig import constants

if len(sys.argv) != 4:
    print("Usage: $python3 join-seq3.py <grpkey str> <memkey str> <cert str>")
    sys.exit()

# Init scheme
groupsig.init(constants.GL19_CODE, 0)

# Import grpkey from the string received from the command line
gpk = grpkey.grpkey_import(constants.GL19_CODE, sys.argv[1])

# Import initial member key
usk = memkey.memkey_import(constants.GL19_CODE, sys.argv[2])

# Run second join member operation
msgin = message.message_from_base64(sys.argv[3])  #.encode())
msgout = groupsig.join_mem(3, gpk, msgin=msgin, memkey=usk)
usk = msgout['memkey']

# Print the challenge response and the temporary key
print("Member key: %s" % memkey.memkey_export(usk))
Example #6
0
#!/usr/bin/env python3
import sys

from pygroupsig import groupsig
from pygroupsig import memkey
from pygroupsig import grpkey
from pygroupsig import message
from pygroupsig import constants

if len(sys.argv) != 3:
    print ("Usage: $python3 join-mem-seq1.py <grpkey str> <challenge str>");
    sys.exit();

# Init scheme
groupsig.init(constants.GL19_CODE, 0)

# Import grpkey from the string received from the command line
gpk = grpkey.grpkey_import(constants.GL19_CODE, sys.argv[1])

# Run second join member operation
msgin = message.message_from_base64(sys.argv[2]);
msgout = groupsig.join_mem(1, gpk, msgin = msgin)
usk = msgout['memkey']

# Print the challenge response and the temporary key
response = msgout['msgout']
print("Response: %s" % message.message_to_base64(response));
print("Temporary member key: %s" % memkey.memkey_export(usk));
Example #7
0
from pygroupsig import memkey
from pygroupsig import grpkey
from pygroupsig import mgrkey
from pygroupsig import gml
from pygroupsig import identity
from pygroupsig import constants

# Setup
bbs04 = groupsig.setup(constants.BBS04_CODE)
gpk = bbs04['grpkey']
msk = bbs04['mgrkey']
gml = bbs04['gml']

# Join
msg1 = groupsig.join_mgr(0, msk, gpk, gml=gml)
msg2 = groupsig.join_mem(1, gpk, msgin=msg1)
usk = msg2['memkey']

# Sign
sig = groupsig.sign("Hello, World!", usk, gpk)

# Verify
b = groupsig.verify(sig, "Hello, World!", gpk)

if b == True:
    print("VALID signature.")
else:
    print("WRONG signature.")
    sys.exit()

# Open