Monday, May 30, 2022
Hash Length of SHA 265
Sunday, May 29, 2022
Does Bitcoin encrypt transactions?
*It is important to note that the core bitcoin network/ledger does not use any encryption. It is all hashing as explained here - https://www.narendranaidu.com/2022/05/ruminating-on-proof-of-work.html
- Hash the data using SHA-256.
- Encrypt the generated hash using your private key.
- Package this encrypted hash and your public key together.
Ruminating on Elliptic Curve Cryptography
When it comes to symmetric encryption, the most common standards are Data Encryption Standards (DES) and Advanced Encryption Standards (AES).
When it comes to asymmetric encryption (public key cryptography), the dominant standard is RSA (Rivest-Shamir-Adleman). Almost all the digital certificates (HTTPS/SSL) issued used RSA as the encryption standard and SHA256 as the hashing algorithm.
Given below is a screenshot of a digital certificate of a random HTTPs site. You can see the encryption algorithm and Hash function mentioned in the certificate.
There is another asymmetric encryption standard called as ECC (Elliptic Curve Cryptography) that is very popular in the crypto world.
ECC has the following advantages when compared to RSA:
- It can run on low end devices (low CPU and memory).
- It is faster - for both encryption/decryption.
- Smaller key size - 256-bit elliptic curve private key is just as secure as a 3072-bit RSA private key. Smaller keys are easier to manage and work with.
Ruminating on Proof of Work
Numeric value of a hash
In the bitcoin network, miners have to compare the hash value during the 'Proof-of-Work' process.
The target hash value is stored in the header and is expressed as a 67-digit number. Miners must find a new hash of the transaction block that is below the given target.
To solve the hash puzzle, miners will try to calculate the hash of a block by adding a nonce to the block header repeatedly until the hash value yielded is less than the target.
But how is the value of the hash calculated? In the bitcoin network, the value of a hash is calculated as follows:
- Hashes are typically represented as a hexadecimal string. Convert the hexadecimal value to decimal value.
- Get the base-2 log of the decimal value.
Thursday, May 26, 2022
Ruminating on dedicated instance vs. dedicated host
Many folks get confused between the AWS terminology of 'Dedicated Instance' vs 'Dedicated Host'.
A simple way to understand the difference is to remember that a "host" is a physical machine that can host many virtual machine instances.
Hence a "dedicated host" is a physical machine that is dedicated to your organization. On this physical machine (host), you can install many VMs/containers. So you control what VMs (instances) are going to run on that host.
So what is a dedicated instance then? A dedicated instance is a virtual machine that runs on hardware that is not shared with other accounts. Dedicated instances are physically isolated at the host hardware level from instances that belong to other AWS accounts. Hence you can only be certain that the underlying hardware that is hosting your VM is not shared with someone else. But you have no fine-grained control over which VM would be launched on which host, etc.
Tuesday, May 17, 2022
Cloud Native Banking Platform - Temenos
Temenos is the world's number one core banking platform. It is built entirely on the AWS cloud and uses all managed services.
I was stuck with the simplicity of the overall architecture on AWS and how it enabled elastic scalability to scale-out for peak loads and also scale-back for reducing operational costs.
Another interesting aspect was the simple implementation of the CQRS pattern to offload queries (read-only API requests) to DynamoDB. The pipeline was built using Kinesis and Lambda.
An excellent short video on the AWS architecture of the Temenos platform is here: https://youtu.be/mtZvA7ARepM