# Private key vs Public Key

In crypto industry ,everyone is supposed to know about private key and public key. We all know that private key shouldn't while we can share public key . Let's breakdown it.

When we first create wallet, we got somethings as Private key. Private key is sensible data that shouldn't be shared. Sharing private key, your wallet will be accessible to other people and s/he can do whatever you can do with your own assests. Exchanging private key is similair to giving wallet to another users.

With the provided private key, Public key is generated using some hashing algorithms. These hashing algorithms are determinsitc and one-way encrypted. Determinsitc means ,one private key will also have one fixed public key . Since it's deterministic , one can thinks if someone reverts the hashing and can get the private key from public key. But ,as I mentioned earlier ,it's one way meaning ,public key is generated using some hashing techniques of private key but reversible is not possible. And also keep in mind that using same hash on public key will generates other random text not private key.

Easy examples : let's say we uses some hashing (SHA256 ) in 12345, outcomes will be :5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5 .

Again if we use same SHA256 to previous outcomes , then new outcomes will be :f0f10862e2590ca124ce80979d7d57dde4bbabbe16eebbb8090ad2317bea9338 (which is obviosuly not 12345).

Thus ,hashing alorithms are one-way encrypted , Thus , getting private keys from public key isn't possilbe.

Reference :

SHA256 : https://demoblockchain.org/hash