ECDSA: Penandatangan dan Verifikasi

Tulisan hari akan membahas mengenai penandatanganan pesan dan verifikasinya dengan ECDSA.

import ecdsa
import hashlib

def sha1(m):
	h = hashlib.sha1()
	h.update(m)
	return h.hexdigest()

m = """In cryptography, the Elliptic Curve Digital Signature 
Algorithm (ECDSA) offers a variant of the Digital Signature 
Algorithm (DSA) which uses elliptic curve cryptography."""

SK = ecdsa.SigningKey.generate() # default NIST192p
VK = SK.get_verifying_key()

signature = SK.sign(m)

print ":: Signature: ", sha1(signature)
print ":: Verified? ", VK.verify(signature, m)

ecdsa1

Semoga Bermanfaat.

Advertisements

One thought on “ECDSA: Penandatangan dan Verifikasi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s