Beispiel #1
0
def elgamalDe(C, C2):
    "Giải mã Elgamal trả về bản rõ m"

    M = EccMath.add_Points(C2, C)
    m = EncodeECC.decode(M)
    return m
Beispiel #2
0
def elgamalDecrypt(C, C2):
    M = EccMath.add_Points(C2, C)
    m = EncodeECC.decode(M)

    return m
Beispiel #3
0
def elgamalEn(m, P):
    "Mã hoá Elgamal tính giá trị C2"

    M = EncodeECC.encode(m)
    C2 = EccMath.add_Points(M, P)
    return C2
Beispiel #4
0
def elgamalEncrypt(m, P):
    M = EncodeECC.encode(m)
    C2 = EccMath.add_Points(M, P)
    return C2