Homework on Public and Private Keys - Questions

Hi there,thanks for adding your note.

1 Like

That section is confusing your right. I watched it several times and could not fully wrap my head around it. I think at this point we are not meant to fully understand how the signature is sent, only that it can be sent. That is probably something explained in more detail later. He did not get too deep into that topic.

Here is an analogy:
Someone sends you a letter to your real world address. He or she knows where you live (public key). The comes into your letterbox. Only you have the key (private key) to your letter box. So that only you can open the box and read the letter.
2.
It can be used for:
Encryption
Digital signature

1 : a public key is like your email address. Everyone can see it and it’s safe to share it with strangers.
A private key is like your email password. You can only send emails(transactions) from your email address (bitcoin wallet) if you know your email password (private key). You should keep private keys offline and safe, while you can freely share your public keys, knowing no one will be able to guess your private key.

2: When you want to send an encrypted message. The other person receiving it needs to have your private key (secret code) to open and read this message.

To store coins in a personal wallet, like bitcoin. Only if you know your private key you can access your funds. While you can send coins to a public key address.

  1. Describe the concept of public and private key with your own words.

Public and private key cryptography are very important concepts in data science and in particular applicable in regards to the technology underlying how Bitcoin and similar cryptocurrencies are able to function securely across public databases, and in the absence of a centralised entity keeping records of all accounts, wallets - as well as transactions and messages sent and received - throughout the network. In technological terms, these concepts address the problems of how to verify who has sent and received a transaction or message. Cryptocurrency wallets in particular function on the basis of public and private key technology and public/private key pairs. This is all made possible because of the the second of the two use cases that are outlined below.

  1. What 2 use-cases can public key cryptography be used for?

The two use cases of public key cryptography are

(a) Encryption, involving a public and private key pair, whereby a large randomised numerical and visible public key can be derived from a large randomised but invisible private key (which due to hashing functions is an input that cannot be derived by the output); the sender encrypts their message or transaction with the recipients public key and the only the recipient can decrypt the message because they have the only private key that can access it and make it readable

(b) the purpose of Digital Signatures & Identification (and the integrity of these); in this case the sender’s invisible private key signs the message that is sent (the digital signature) and it also generates the unique public key (as described above in the previous section); therefore the sender is able to verify mathematically by taking the digital signature and the public key that it was indeed the recipient’s private key that sent the message. This is used in Bitcoin (& similar cryptocurrencies) whereby the messages are actually transactions.

Furthermore the blockchain (& nodes on the network) can also verify the transaction by way of this process to record on the ledger that the recipient’s private key generated both the public key and the digital signature and that the recipient’s public key (derived from their own private key) received the transaction. Therefore they can verify by consensus and with finality, once a transaction is confirmed, that the sender did indeed pay the recipient, and that the recipient now owns the Bitcoin (or other cryptocurrency) that they received.

In terms of security and data integrity, the chances of a new user’s wallet or Bitcoin address generating the same private key as someone else’s existing private key are so vanishingly small that they can be disregarded for all practical purposes. And lastly for sequencing and identification purposes, it is the wallet that creates the private key, and it is then the private key that derives the public key, which lastly gives a user their wallet address. As with hash functions, this is a one way process.

Correct, but how about current use cases? Like encrypting a message.

Hi there! Just a minor correction, as you use your private key to sign a message, which will then return a signature.

Yes, but in this example, how will the letter be inserted in the letterbox?? :smiley: Still a good analogy!

You can use their public key to encrypt a message, and only the recipient’s corresponding private key can decrypt it.

1 Like

digital signatures are created by some signing algorithm that uses your public & private key, a message and some secret. So you never reveil your private key, but you can still proof by this verification algorithm that the signature can only be produced by some private key.

In blockchain networks, digital signatures work using hash and public/private key pairs. The Digital Signatures on blockchain networks work as follows,

SENDER:
Step 1: The sender of the transaction message(Alice) creates a hash of the message. This may be done using a SHA256 algorithm.

Step 2: This hash of the message is encrypted using the sender’s (Alice’s) private key. This is called Digitally Signing the message.

Step 3: This Digitally Signed message i.e. the private key encryted [data + SHA256 hash(data)] , along with the sender’s(Alice’s) public key, is now broadcast over the network.

RECEIVER:
Step 1: When a node wants to validate the transaction (i.e. check for user authenticity and transaction data integrity), they first use Alice’s public key to decrypt the message. Since only Alice’s public key can decrypt a message signed by Alice’s private key, the node is assured that the sender of the message is Alice, and user authentication is satisfied.

Step 2: After decrypting the message the validating node now has the transaction data + senders SHA256 hash(data). To ensure transaction integrity, the node runs the transaction data via the SHA256 algorithm on their end and compares it with the senders SHA256 hash(data). If they both match then data integrity is established.
If the two hashes do not match then the validating node knows that the transaction data that was received was modified in some way and can discard that transaction data.

by the postman :smiley:

1 Like
  1. Private and Public Keys are a part of Cryptography for either Encryption of a message or to verify digital signatures. Private keys are a large string of items that are randomly generated by a computer. In the case of a personal Bitcoin wallet, your computer generates this key. I can then be used to generate a Public Key for your wallet. The Private Key controls the security and sending transactions with that wallet. It is used to verify your signature or authority of that wallet. The public key is the address or public name for that wallet and can only be used to receive bitcoin from a sender. The public key cannot be used to uncover the associated private key or gain any control over that wallet. Since the private key was a large randomly generated sequence of characters, if lost, in part or completely, it is impossible to recreate or retrieve, and the contents of that wallet would be lost to the owner. Hence all of the cautions to safeguard your private keys.

  2. the 2 cases are Encryption of messages or verifying Identity with Digital Signatures.

1 Like

1.) Public is key the key you share to many people and they use to to encrypt data only you can decrypt And the Private key is the key you keep in private with one person to another.
2.Sending message or sending funds where you transact with others.

1 Like
  1. public and private key’s can be used to take something on a open network and make it so it is only meant for one person(or address). The public key is derived out of the private key. The public key is the one that is known by the network. Others will use the public key if they want to address something for you. The private key is the only way to open something that is addressed to you.

  2. It can be used for a private messaging. And it can be used for blockchain interactions

1 Like
  1. Private key is random number generated, which identifies you in a network. To exchange messages with others in same environment, is used a public key, which is derive from private key. This public key can be shared to anyone, and encrypt messages. Since message is verified mathematically, only the holder of private key can see messages signed with their public key.

  2. Two use cases are digital signed documents, like a pdf, and email encryption exchange.

1 Like
  1. Private key is a random set of bytes that is kept secret and is never shared. Public key is generated from the private key using a one way function and is shared with any external actors.
  2. Encrypting messages between two actors and signing messages to verify the message is from a verified source.
1 Like

1)A private key is a large random number that is unlikely to random generated by another event. Collision so unlikely that the universe will collapse before it happens. This private key is always kept secret by the owner. This private key can be used to generate a public key which is visible by anyone. This is a one way process. It is impossible to reverse engineer the private key from the public key. The public key can be used to encrypt a file that only the only of the private key can decrypt.

  1. Use case 1. Encrypting messages between parties. Public key is used by one party to encrypt message to the other party using the other parties public key.
    Use case 2 Signing messages using private key in application like Bitcoin for sending coins to another address. In Bitcoin the private/public key is combined to create unique Bitcoin address.
1 Like

Public and Private key Homework:
1.Describe the concept of public and private keys.
Public and private keys are used to securely encrypt messages and decrypt into the original form, they are used as digital signatures mathematically ensuring the integrity and identity of the participants.
2.What two use-cases can public key cryptography be used for.
Public keys can be used to encrypt messages and as digital signatures.

1 Like

1.- Private key as the word says must be kept private. The Public Key is a Hash of the Private Key. I can provide my Public Key to anyone so I can get messages, get transactions etc. My public key and all activity I perform in the blockchain will have a signature of my private key.

2.- Encryption and Digital Signature.

1 Like
  1. a public key is the output of a function, ususually a hash, for which the private key is the input.
  2. a) securing messages sent on an open communication channel (encrypting the plain text message)
    b) signing a message (verification of the message sender)
1 Like