Editing
Public Key Crypto
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Modeling 'The Diffie-Hellman Key Exchange':''' <syntaxhighlight lang="python"> def generate_shared_secret(g, p, my_private_key, their_public_part): """ Shows how two people can create a secret key without ever sending the key itself. Formula: (g^b mod p)^a mod p == (g^a mod p)^b mod p """ shared_secret = (their_public_part ** my_private_key) % p return shared_secret # Alice and Bob agree on g=5, p=23 # Alice chooses private_a=6. Bob chooses private_b=15. # Alice sends (5^6 mod 23) = 8. Bob sends (5^15 mod 23) = 19. alice_secret = generate_shared_secret(5, 23, 6, 19) bob_secret = generate_shared_secret(5, 23, 15, 8) print(f"Alice's secret: {alice_secret}") print(f"Bob's secret: {bob_secret}") # They both calculated '2' without ever sending it! </syntaxhighlight> ; Asymmetric Landmarks : '''PGP (Pretty Good Privacy)''' β The first software to bring public-key encryption to the masses for email. : '''Bitcoin''' β Uses '''ECC''' to prove ownership of coins without needing a bank. : '''The Green Padlock''' β The visual indicator in your browser that a site is using public-key crypto (TLS). : '''SSH Keys''' β Used by developers to log into servers without using a password. </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information