Bitcoin can be thought of as open messaging system secured by public key cryptography. Similarly in contrast to other system protected by username and password logins, Bitcoin is secured through digital messages signatures created with a unique private key. this single point of access places a high value on secure generation, use and storage of private keys.
Bitcoin solve both the problems that is public and private keys through a system called public key cryptography, this system uses two pieces of information to authenticate or verify the messages. A public key identifies a sender or recipient, and can be distributed to others, similarly a private key creates an unforgeable message signature. These public and private keys are mathematically linked through a signature algorithm which is mathematical procedure for creating identities, signing and validating messages.
Bitcoin private key is just a number which is simply an integer between one and about 10^77. This is very large number which is almost impossible to reverse, this makes bitcoin transaction more safe.
Transactions are actually messages signed with a private key. To prevent forgery or fabrication bitcoin requires that each transaction bear a digital signature. This signature, like a private key is just a number selected from a very large range. wallet software generates a signature by mathematically processing a transaction together with the correct private key. Anyone with a signature and public key can easily authenticate a message. the only way to produce a valid message signature is to use use the private key matching the published public key. in other words, digital signature are practically impossible to forge.
In a nutshell, public key cryptography is one of the safe mode of transaction by using blockchain technology.