Exemplo n.º 1
0
def parseAESMonteKernelLogLine(line, logData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (
            not paramsDict.has_key('count')) or (
                not paramsDict.has_key('enc')):
        return
    filename = paramsDict['file']
    count = paramsDict['count']
    enc = paramsDict['enc']
    (start, end) = getBuffer(line)
    ct = line[start:end]
    (start, end) = getBuffer(line, end + 1)
    key = line[start:end]
    (start, end) = getBuffer(line, end + 1)
    pt = line[start:end]
    (start, end) = getBuffer(line, end + 1)
    iv = None
    if end != -1:
        iv = line[start:end]
    encDecDict = logData.get(filename)
    if encDecDict == None:
        encDecDict = {}
        logData[filename] = encDecDict
    countDict = encDecDict.get(enc)
    if countDict == None:
        countDict = {}
        encDecDict[enc] = countDict
    countDict[int(count)] = {}
    countDict[int(count)]['ciphertext'] = ''.join(ct.split())
    countDict[int(count)]['key'] = ''.join(key.split())
    countDict[int(count)]['plaintext'] = ''.join(pt.split())
    if iv != None:
        countDict[int(count)]['iv'] = ''.join(iv.split())
def parseTDESMonteKernelLogLine(line, tdesLogData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (not paramsDict.has_key('count')) or (not paramsDict.has_key('enc')):
        return
    filename = paramsDict['file']
    count = paramsDict['count']
    enc = paramsDict['enc']
    (start, end) = getBuffer(line)
    ct = line[start:end]
    (start, end) = getBuffer(line, end + 1)
    key = line[start:end]
    (start, end) = getBuffer(line, end + 1)
    pt = line[start:end]
    (start, end) = getBuffer(line, end + 1)
    iv = None
    if end != -1:
        iv = line[start:end]
    encDecDict = tdesLogData.get(filename)
    if encDecDict == None:
        encDecDict = {}
        tdesLogData[filename] = encDecDict
    countDict = encDecDict.get(enc)
    if countDict == None:
        countDict = {}
        encDecDict[enc] = countDict
    countDict[int(count)] = {}
    countDict[int(count)]['ciphertext'] =''.join(ct.split())
    countDict[int(count)]['key'] =''.join(key.split())
    countDict[int(count)]['plaintext'] =''.join(pt.split())
    if iv != None:
        countDict[int(count)]['iv'] =''.join(iv.split())
def parseRNGKernelLogLine(line, rngLogData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (not paramsDict.has_key('count')):
        return
    (start, end) = getBuffer(line)
    filename = paramsDict['file']
    count = paramsDict['count']
    hexbuf = line[start:end]
    countDict = rngLogData.get(filename)
    if countDict == None:
        countDict = {}
        rngLogData[filename] = countDict
    countDict[int(count)] =''.join(hexbuf.split())
Exemplo n.º 4
0
def parseRNGKernelLogLine(line, rngLogData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (not paramsDict.has_key('count')):
        return
    (start, end) = getBuffer(line)
    filename = paramsDict['file']
    count = paramsDict['count']
    hexbuf = line[start:end]
    countDict = rngLogData.get(filename)
    if countDict == None:
        countDict = {}
        rngLogData[filename] = countDict
    countDict[int(count)] = ''.join(hexbuf.split())
def parseTDESKernelLogLine(line, tdesLogData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (not paramsDict.has_key('count')) or (not paramsDict.has_key('enc')):
        return
    (start, end) = getBuffer(line)
    filename = paramsDict['file']
    count = paramsDict['count']
    enc = paramsDict['enc']
    hexbuf = line[start:end]
    encDecDict = tdesLogData.get(filename)
    if encDecDict == None:
        encDecDict = {}
        tdesLogData[filename] = encDecDict
    countDict = encDecDict.get(enc)
    if countDict == None:
        countDict = {}
        encDecDict[enc] = countDict
    countDict[int(count)] =''.join(hexbuf.split())
def parseHMACKernelLogLine(line, hmacLogData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (not paramsDict.has_key('count')) or (not paramsDict.has_key('hash_size')):
        return
    (start, end) = getBuffer(line)
    filename = paramsDict['file']
    count = paramsDict['count']
    hash_size = paramsDict['hash_size']
    hexbuf = line[start:end]
    sizeDict = hmacLogData.get(filename)
    if sizeDict == None:
        sizeDict = {}
        hmacLogData[filename] = sizeDict
    countDict = sizeDict.get(hash_size)
    if countDict == None:
        countDict = {}
        sizeDict[hash_size] = countDict 
    countDict[int(count)] =''.join(hexbuf.split())
Exemplo n.º 7
0
def parseHMACKernelLogLine(line, hmacLogData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (
            not paramsDict.has_key('count')) or (
                not paramsDict.has_key('hash_size')):
        return
    (start, end) = getBuffer(line)
    filename = paramsDict['file']
    count = paramsDict['count']
    hash_size = paramsDict['hash_size']
    hexbuf = line[start:end]
    sizeDict = hmacLogData.get(filename)
    if sizeDict == None:
        sizeDict = {}
        hmacLogData[filename] = sizeDict
    countDict = sizeDict.get(hash_size)
    if countDict == None:
        countDict = {}
        sizeDict[hash_size] = countDict
    countDict[int(count)] = ''.join(hexbuf.split())
def parseTDESKernelLogLine(line, tdesLogData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (
            not paramsDict.has_key('count')) or (
                not paramsDict.has_key('enc')):
        return
    (start, end) = getBuffer(line)
    filename = paramsDict['file']
    count = paramsDict['count']
    enc = paramsDict['enc']
    hexbuf = line[start:end]
    encDecDict = tdesLogData.get(filename)
    if encDecDict == None:
        encDecDict = {}
        tdesLogData[filename] = encDecDict
    countDict = encDecDict.get(enc)
    if countDict == None:
        countDict = {}
        encDecDict[enc] = countDict
    countDict[int(count)] = ''.join(hexbuf.split())
def parseAESKernelLogLine(line, logData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (not paramsDict.has_key('count')) or (not paramsDict.has_key('enc')):
        return
    (start, end) = getBuffer(line)
    if start == -1 or end == -1:
        print 'Possible interrupted buffer.Line=', line
        return
    filename = paramsDict['file']
    count = paramsDict['count']
    enc = paramsDict['enc']
    hexbuf = line[start:end]
    encDecDict = logData.get(filename)
    if encDecDict == None:
        encDecDict = {}
        logData[filename] = encDecDict
    countDict = encDecDict.get(enc)
    if countDict == None:
        countDict = {}
        encDecDict[enc] = countDict
    countDict[int(count)] =''.join(hexbuf.split())
Exemplo n.º 10
0
def parseAESKernelLogLine(line, logData):
    paramsDict = getParams(line)
    if (not paramsDict.has_key('file')) or (
            not paramsDict.has_key('count')) or (
                not paramsDict.has_key('enc')):
        return
    (start, end) = getBuffer(line)
    if start == -1 or end == -1:
        print 'Possible interrupted buffer.Line=', line
        return
    filename = paramsDict['file']
    count = paramsDict['count']
    enc = paramsDict['enc']
    hexbuf = line[start:end]
    encDecDict = logData.get(filename)
    if encDecDict == None:
        encDecDict = {}
        logData[filename] = encDecDict
    countDict = encDecDict.get(enc)
    if countDict == None:
        countDict = {}
        encDecDict[enc] = countDict
    countDict[int(count)] = ''.join(hexbuf.split())