Пример #1
0
def ct_open(sfd):
    print "CTOPEN message: "
    myargs = {
        KEY_PEERNICK: "rlfrl",
        KEY_BLOB: DATA_BLOB,
        KEY_CHANNEL: "#prout"
    }

    acblob = ac_msg(ACMSG_TYPE_CRYPTO, ACMSG_SUBTYPE_CTOPEN, myargs)
    sfd.send(acblob)
    rcvblob = sfd.recv(4096)

    ac_msg_test = ac_pb2.ArseneCryptoMessage()
    ac_msg_test.ParseFromString(rcvblob)
    print "message type:"
    print ac_msg_test.type

    ac_ctr = ac_pb2.acCipherTextMessageResponse()
    ac_ctr.ParseFromString(ac_msg_test.blob)
    print "CTR message type:"
    print ac_ctr.type
    print "CTR message bada:"
    print ac_ctr.bada
    print "CTR message error_code:"
    print ac_ctr.error_code
    print "CTR message blob:"
    print ac_ctr.blob

    return ac_ctr.blob
Пример #2
0
def ct_open(sfd):
    print "CTOPEN message: " 
    myargs = { KEY_PEERNICK:"rlfrl", KEY_BLOB:DATA_BLOB, KEY_CHANNEL:"#prout" }

    acblob = ac_msg(ACMSG_TYPE_CRYPTO, ACMSG_SUBTYPE_CTOPEN, myargs)
    sfd.send(acblob)
    rcvblob = sfd.recv(4096)

    ac_msg_test = ac_pb2.ArseneCryptoMessage()
    ac_msg_test.ParseFromString(rcvblob)
    print "message type:"
    print ac_msg_test.type

    ac_ctr = ac_pb2.acCipherTextMessageResponse()
    ac_ctr.ParseFromString(ac_msg_test.blob)
    print "CTR message type:"
    print ac_ctr.type
    print "CTR message bada:"
    print ac_ctr.bada
    print "CTR message error_code:"
    print ac_ctr.error_code
    print "CTR message blob:"
    print ac_ctr.blob

    return ac_ctr.blob
Пример #3
0
def ct_seal(sfd):
    print "CTSEAL message: "
    myargs = {
        KEY_MYNICK: "frlfrl",
        KEY_BLOB: "this is a message to say yay!!!!",
        KEY_CHANNEL: "#prout"
    }

    acblob = ac_msg(ACMSG_TYPE_CRYPTO, ACMSG_SUBTYPE_CTSEAL, myargs)
    sfd.send(acblob)
    rcvblob = sfd.recv(4096)

    ac_msg_test = ac_pb2.ArseneCryptoMessage()
    ac_msg_test.ParseFromString(rcvblob)
    print "message type:"
    print ac_msg_test.type

    ac_ctr = ac_pb2.acCipherTextMessageResponse()
    ac_ctr.ParseFromString(ac_msg_test.blob)
    print "CTR message type:"
    print ac_ctr.type
    print "CTR message bada:"
    print ac_ctr.bada
    print "CTR message error_code:"
    print ac_ctr.error_code
    print "CTR message blob:"
    print ac_ctr.blob

    return ac_ctr.blob
Пример #4
0
def ct_seal(sfd):
    print "CTSEAL message: " 
    myargs = { KEY_MYNICK:"frlfrl", KEY_BLOB:"this is a message to say yay!!!!", KEY_CHANNEL:"#prout" }

    acblob = ac_msg(ACMSG_TYPE_CRYPTO, ACMSG_SUBTYPE_CTSEAL, myargs)
    sfd.send(acblob)
    rcvblob = sfd.recv(4096)

    ac_msg_test = ac_pb2.ArseneCryptoMessage()
    ac_msg_test.ParseFromString(rcvblob)
    print "message type:"
    print ac_msg_test.type

    ac_ctr = ac_pb2.acCipherTextMessageResponse()
    ac_ctr.ParseFromString(ac_msg_test.blob)
    print "CTR message type:"
    print ac_ctr.type
    print "CTR message bada:"
    print ac_ctr.bada
    print "CTR message error_code:"
    print ac_ctr.error_code
    print "CTR message blob:"
    print ac_ctr.blob

    return ac_ctr.blob