12102040701140
12102040701140
12102040701140
Types of Cryptography:
1. Symmetric Key Cryptography: It is an encryption system where the sender and receiver
of a message use a single common key to encrypt and decrypt messages. Symmetric Key
cryptography is faster and simpler but the problem is that the sender and receiver have to
somehow exchange keys securely. The most popular symmetric key cryptography systems
are Data Encryption Systems (DES) and Advanced Encryption Systems (AES).
int main() {
// Key and IV (Initialization Vector) for AES
byte key[AES::DEFAULT_KEYLENGTH] = {'k', 'e', 'y', '1', '2', '3', '4', '5', '6', '7', '8', '9', '
1', '0', '1', '1'};
byte iv[AES::BLOCKSIZE] = {'i', 'v', '1', '2', '3', '4', '5', '6', '7', '8', '9', '1', '0', '1', '1', '1'};
// Message to be encrypted
string plainText = "Hello, AES!";
return 0;
}
Output:
Implementation:
Code:
#include<iostream>
#include<math.h>
using namespace std;
// find gcd
int gcd(int a, int b) {
int t;
while(1) {
t= a%b;
if(t==0)
return b;
a = b;
b= t;
}
}
int main() {
//2 random prime numbers
double p = 13;
double q = 11;
double n=p*q;//calculate n
double track;
double phi= (p-1)*(q-1);//calculate phi
//public key
//e stands for encrypt
double e=7;
//for checking that 1 < e < phi(n) and gcd(e, phi(n)) = 1; i.e., e and phi(n) are coprime.
Output:
Bitcoin is a cryptocurrency, a new kind of payment network and money. It was created
by a person or group, going by the username Satoshi Nakamoto, who posted a
whitepaper on a discussion board.
Bitcoin makes money for investors through appreciation, the increase of an asset's
market value. There's a lot going on behind the scenes in the Bitcoin network, so here's
a detailed primer designed to help you further your understanding of this digital
phenomenon.
The Bitcoin network maintains a distributed public ledger that records the ownership
of all bitcoin, the native digital asset token of the network. New transactions are
grouped together into “blocks” and added sequentially to the network’s ongoing chain
of blocks — hence the term “blockchain.” The Bitcoin blockchain contains every block
since inception, stretching all the way back to the first block known as the “Genesis
Block.”
Identical copies of the blockchain are hosted on computers around the world that run
the Bitcoin software. These computers are called "nodes." This design ensures that no
single entity is in control of the blockchain or protocol that governs it. Bitcoin's
distributed nature makes it decentralized and resistant to being controlled (or shut
down) by any government or central authority. Theoretically, all nodes that maintain a
complete copy of the blockchain — known as "full nodes" — would need to be
destroyed in order to erase the Bitcoin blockchain. No small task as there are even full
nodes floating above the earth in space!
Anatomy of a Block:
Each Bitcoin block is limited in size to one megabyte of data. For “Segregated
Witness” (SegWit) blocks, transaction data is limited to one megabyte, whereas
signature data (aka witness) is segregated and limited to three megabytes. This keeps
the block size at one megabyte while increasing block space for transaction data.
A block contains the following information:
A Block header:
1. Version number
2. Hash of the previous block header
3. Hash of the root of Merkle tree of all the transactions in the current block
4. Timestamp
5. Difficulty target of the current block (meaning how difficult the target hash will be to
find)
6. Nonce
Bitcoin Forks
A fork occurs when an existing blockchain splits into two different blockchains. This
happens when an update is made to a protocol that not all of the nodes adopt. There are
two types of forks that blockchains can experience; a soft fork, whereby old nodes and
new nodes are able to read both blockchains (compatible); and a hard fork, whereby old
nodes cannot read the new blockchain and vice versa (incompatible). Hard forks result
in two separate blockchains with distinct native digital asset tokens that are separate
and apart from each other.
When updates are made to the Bitcoin protocol, individual nodes must determine if they
will upgrade and accept the new changes or not. If a constituent of nodes within the
network refuses to adopt the changes, then a hard fork results. Bitcoin has experienced
several forks of both kinds, including the Bitcoin Cash hard fork that occurred at block
661,647, the last common block between Bitcoin and Bitcoin Cash. The Bitcoin Cash
fork emanated from a disagreement in the Bitcoin community around block size.
Bitcoin Cash adopted a block size of eight megabytes to increase transaction
throughput, whereas Bitcoin kept a block size of one megabyte to foster greater node
participation and ensure decentralization.
2. After that, we have exploring the block using SHA-256 algorithm. In this we have
enter some data in transaction data and click on start mining.
Bitcoin Wallet:
In the simplest of terms, a Bitcoin wallet is something that allows you to hold, send,
receive, access, and manage Bitcoin (BTC). You can think of them much like the wallet
you carry around in your pocket apart from the underlying tech is a bit more
complicated.
See, Bitcoin wallets don’t actually store Bitcoin. Your cryptocurrency is always stored
on the blockchain. Your Bitcoin wallet’s purpose is to generate and store private keys
that allow you to access and manage different Bitcoin accounts.
1. Mobile: Mobile wallets, like WazirX multi-cryptocurrency wallet and Exodus bitcoin
wallet are those that run as apps on phones, tablets and other mobile devices.
2. Web: Web-based wallets, like Guarda Bitcoin Wallet, store your coins through an
online third party. You can gain access to your coins and make transactions through
any device that lets you connect to the internet. These web-based wallets are frequently
associated with crypto exchanges that allow you to trade and store crypto all in one
place.
4. Hardware: Hardware wallets are physical devices, like a USB drive, that are not
connected to the web. These include Ledger Nano X Bitcoin Wallet and Trezor Model
T Bitcoin Wallet available in India. To make transactions, you first need to connect the
hardware wallet to the internet, either through the wallet itself or through another
device with internet connectivity. There is typically another password involved to
make the connection, which increases security but also raises the risk you may lock
yourself out of your crypto if you lose the password.
5. Paper Wallets: In a paper wallet, you print off your key, typically a QR code, on a
paper document. This makes it impossible for a hacker to access and steal the password
online, but then you need to protect the physical document.
What is MetaMask?
Public blockchains like Ethereum are the next evolution of Internet databases, and
MetaMask is the next evolution of the browser.
MetaMask is a web browser extension and mobile app that allows you to manage your
Ethereum private keys. By doing so, it serves as a wallet for Ether and other tokens,
and allows you to interact with decentralized applications, or dapps. Unlike some
wallets, MetaMask keeps no information on you: not your email address, not your
password, and not your Secret Recovery Phrase or other private keys. You retain all
power over your crypto-identity.
1. Visit https://metamask.io/
2. Click “Download".
3. Click on "Install MetaMask for Chrome". Ignore the alarm bells that are ringing: the
reason it says "Chrome" here is because Brave is a Chromium-based browser and
shares the Web Store with Chrome itself.
4. In the Chrome Store that opens, click 'Add to Brave'.
7. After that, check in checkbox for terms and conditions and click on agree.
9. After that click on secure my wallet, and we have seen that, wallet was created
successfully.
2. Step 2: As in this method, we are installing the application using Snap Manager, we will
first need to install Snap Manager on our system. So to install the Snap Manager on our
system, execute the below command in the Linux Terminal.
3. Once the installation of Snap Manager is done, we can install the Bitcoin Core application
using Snap Manager. Execute the below command to install the Bitcoin Core application
using Snap Manager.
5. To launch the application for usage, we can search the Bitcoin Core application in the All
Applications section. As shown in the below screenshot, we have got the icon of the
application that can be launched by clicking on it.
7. After that, we have seen one window, which is indicated a current balance.
9. We have try to understand about the bitcoin send and bitcoin receive function.
At its core, IPFS works by breaking down files into smaller pieces called “blocks” and
storing them across multiple nodes in the network. This means that files are not stored
in a single location, but rather distributed across the network, making it highly resilient
to failure and censorship.
3. Peers Screen