April 16, 2018

An algorithm in cryptocurrency - how does it work?



There are a lot of algorithm types and uses to it, starting from computer science to math science. It can be anywhere. In nowadays we know that IT uses a lot of algorithms. For example, search engine algorithm - it takes user input keywords, then searches associated database for relevant web pages, and returns results.


At first, you need to know what is encryption and what is decryption to better understand the algorithm so you don't get lost in this article:
Encryption - the process of encoding a message (information) in such a way that only authorized parties can access it. In encryption, the message is encrypted using encryption algorithm and can be read only if decrypted.
Decryption - the reverse process of converting encoded data to its original un-encoded form, plaintext.


For example:
Decrypted text:
H6Itvx0PiWm3QqSRyo/OC6KeYKYCnMUNZi9O070B4k0=
Encrypted text:
this was decrypted text
You can try by yourself: http://www.online-toolz.com/tools/text-encryption-decryption.php


So what is an algorithm?

In computer science, an algorithm is an unambiguous specification of how to solve a class of problems. It is a formula that is solving a problem, based on conducting a sequence of specified actions. It can perform the calculation, data processing, and automated reasoning tasks.

Let's take an example from life:
Let's suppose that you need to get to your friend's house but there is the problem because you don't know how to get there, and that's why there are few algorithms to solve the problem, so you can get to your friend's house:

Number one - call your friend to ask for directions algorithm
1) Call your friend;
2) Ask how to get to his house;
3) Go to your friend's house.

Number two - taxi algorithm
1) call your friend;
2) get his address;
3) call a taxi and go to the given address;

Number three - wait for your friend algorithm
1) Get to the meeting place where you will meet;
2) Wait for your friend;
3) Go to your friend's house with him.

Which one of those three would you choose?
It is the best to choose the fastest one because you won't waste your time right?

Algorithm in cryptography



In cryptography, an algorithm is divided into three groups which are:
Symmetric algorithms (Also known as Secret Key Cryptography or SKC)- it uses the same cryptographic keys for both encryptions of plaintext and decryption of ciphertext. by holding the key, you can exchange messages with anybody else holding the same key.
Here are some of the most popular symmetric algorithms:
Blowfish - symmetric block cipher that can be used as a drop-in replacement for DES or IDEA.
DES (Full name The Data Encryption Standard) - an algorithm for the encryption of electronic data.
3DES (Triple DES) - block cipher, which applies the DES cipher algorithm three times to each data block.
AES (Full name is "The Advanced Encryption Standard") - a symmetric block cipher chosen by the U.S. government to protect classified information and is implemented in software and hardware throughout the world to encrypt sensitive data.

Asymmetric algorithms (also known as Public Key Cryptography or ) - uses public and private keys to encrypt and decrypt data.
Here are 3 of asymmetric algorithms:
Diffie-Hellman - method of securely exchanging cryptographic keys over a public channel.
RSA - used for secure data transmission, based on the practical difficulty of the factorization of the product of two large prime numbers, the "factoring problem".
Elliptic Curve - an approach to public-key cryptography based on the algebraic structure of elliptic curves over finite fields.

Hash functions - any function that can be used to map data of arbitrary size to data of fixed size.
Some of the hash functions include:
MD5 - message authentication protocol to verify the content of the message.
SHA 1 - it takes an input and produces a 160-bit hash value known as a message digest.
The SHA 2 family (SHA-128, SHA-192, and SHA-256) - A family of two similar hash functions, with different block sizes, known as SHA-256 and SHA-512. They differ in the word size; SHA-256 uses 32-bit words where SHA-512 uses 64-bit words. There are also truncated versions of each standard, known as SHA-224, SHA-384, SHA-512/224, and SHA-512/256. These were also designed by the NSA.
The SHA 3 family - A hash function formerly called Keccak, chosen in 2012 after a public competition among non-NSA designers. It supports the same hash lengths as SHA-2, and its internal structure differs significantly from the rest of the SHA family.

How do algorithms affect cryptocurrency?

In cryptocurrency algorithm means - set of heuristics and calculations that create a model from data.
So it is a procedure that solves a problem, and in cryptocurrency mining, the problem is- validating transactions-,
and with an algorithm, the mining is done.

What algorithm does in cryptocurrency:
  • Verify the integrity of data (method for talking large amounts of data and systematically representing it as a short number that is difficult to replicate);
  • maintain the structure of blockchain data (It holds people's account balances);
  • encode people’s account addresses and as part of the process of encoding transactions between accounts;
  • generate math puzzles that make “block mining” possible;
  • makes heavy use of block ciphers, (a technology that was originally used for traditional cryptography).

Sources:
https://www.globalsign.com/en/blog/glossary-of-cryptographic-algorithms/
http://cryptofundamentals.com/algorithms
https://blog.storagecraft.com/5-common-encryption-algorithms/
https://www.brighthub.com/computing/enterprise-security/articles/65254.aspx
https://whatis.techtarget.com/definition/algorithm
https://www.schneier.com/academic/blowfish/
https://en.wikipedia.org/wiki/Data_Encryption_Standard
https://en.wikipedia.org/wiki/Triple_DES
https://searchsecurity.techtarget.com/definition/Advanced-Encryption-Standard
https://searchsecurity.techtarget.com/definition/asymmetric-cryptography
https://en.wikipedia.org/wiki/RSA_(cryptosystem)
https://en.wikipedia.org/wiki/SHA-1
https://www.manomayasoft.com/blog/item/163-encryption-and-decryption-algorithm
https://en.wikipedia.org/wiki/Algorithm

No comments: