<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Avinash Buddana on Medium]]></title>
        <description><![CDATA[Stories by Avinash Buddana on Medium]]></description>
        <link>https://medium.com/@avinashbuddana4?source=rss-90991b77204a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qziTwuNkmW0odSoAxRNWEA.png</url>
            <title>Stories by Avinash Buddana on Medium</title>
            <link>https://medium.com/@avinashbuddana4?source=rss-90991b77204a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 13:29:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@avinashbuddana4/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Merkel tree]]></title>
            <link>https://medium.com/@avinashbuddana4/merkel-tree-7c1e00e136b0?source=rss-90991b77204a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c1e00e136b0</guid>
            <category><![CDATA[merkle-tree]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Avinash Buddana]]></dc:creator>
            <pubDate>Sun, 12 Jun 2022 12:35:25 GMT</pubDate>
            <atom:updated>2022-06-12T12:35:25.151Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Merkle Tree</strong>?</p><ul><li>A hash tree or Merkle tree is a tree structure in which each leaf node is a hash of a block of data and each non-leaf node is a hash of its children.This results in a single hash called the Merkle root. If every node has two children, the tree is called a binary hash tree.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cep6dsEehJM3KY9JMFduqA.png" /></figure><p>Using a Merkle tree provides integrity and validity of your data using a small amount of data that a trusted authority has to maintain.This also means little memory / disk space is needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bXgU8phcxcO37LMXeOObNQ.png" /></figure><p>The above image depicts how to verify a single data is available in node or not.</p><p><strong>Why use a Merkle tree</strong>?</p><p>Why not hash all messages, append the hashed messages and then hash it all to get one root hash value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oo3CbakBjHFjywWeo_VczQ.png" /></figure><p>Suppose Bob get the root hash from a trusted source. If Alice wants to proof to Bob that m6 is not tampered with, she needs to send message m6 and all other hashed messages to Bob. Bob hashes message m6, append all hashes to a single string and hash this string to get one root hash. Bob compares this new root hash with the trusted source root hash to check if message m6 is not tampered with.</p><ul><li>In this example Alice has to provide 15 hashed values and the message m6 to Bob to prove that message m6 is not tampered with.</li></ul><p>A much better solution is using a Merkle tree.</p><p>Again as before Bob gets the root hash from a trusted source. If Alice wants to proof that m6 is not tampered with, she needs to send m6 and 4 hashed values to Bob. With the received information Bob calculates the root hash value. Bob compares this root hash with the trusted source root hash to check if message m6 is not tampered with.</p><p>In this example Alice only needs to provide 4 hashed values and the message m6 to Bob to prove that message m6 is not tampered with.</p><p>If a Merkle tree has more leaves less hashed values are needed, in comparison to the number of leaves, to validate if a message is not tampered with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5PkaETlh5v5cy7mjvPd1g.png" /></figure><p>A perfect Merkle binary tree has the following properties:</p><ul><li>The number of leaves is always 2n (n=0, 1, 2, 3,..).</li><li>Each node has 0 or 2 children.</li><li>All leaves are on the same level.</li></ul><p><strong>In a perfect binary tree the following formulas can be applied:</strong></p><p>Total number of leaves: L = <strong>(N + 1) /2</strong></p><p>Total number of nodes: N = <strong>2L - 1</strong></p><p>Total number of levels : LV =<strong>log2(L) + 1 OR LV = (ln(L) / ln(2)) + 1</strong></p><p><strong>Merkle Tree Implementation</strong>:</p><p>I have used node js to whitelist users from list of users .You can find my implementation in my<a href="https://github.com/avinashbuddana/Merkle-Tree-"> GITHUB</a> repo . I used Node js with package <a href="https://www.npmjs.com/package/merkletreejs">MerkleJs</a> and for verifying i used solidity contract we can verify using merkle js package also .</p><p>Hope you enjoyed reading our article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c1e00e136b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Install Nginx And Secure Nginx with Let’s Encrypt on Ubuntu]]></title>
            <link>https://medium.com/@avinashbuddana4/how-to-install-nginx-and-secure-nginx-with-lets-encrypt-on-ubuntu-295360dcbe?source=rss-90991b77204a------2</link>
            <guid isPermaLink="false">https://medium.com/p/295360dcbe</guid>
            <category><![CDATA[certbot]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[ubuntu-server]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[freesssl]]></category>
            <dc:creator><![CDATA[Avinash Buddana]]></dc:creator>
            <pubDate>Fri, 21 Feb 2020 13:52:09 GMT</pubDate>
            <atom:updated>2020-04-03T11:32:02.630Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p><strong>Let’s Encrypt</strong> is a non-profit certificate authority run by Internet Security Research Group (ISRG) that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge. The certificate is valid for 90 days, during which renewal can take place at any time. The offer is accompanied by an automated process designed to overcome manual creation, validation, signing, installation, and renewal of certificates for secure websites.</p><p>In this tutorial, I will demonstrate how to install NGINX, configure server block and securing it with Let’s Encrypt.</p><p>This tutorial will use a separate Nginx server block file instead of the default file. I recommend creating new Nginx server block files for each domain because it helps to avoid common mistakes and maintains the default files as a fallback configuration.</p><h3>Step 1: Install Nginx</h3><pre>sudo apt-get update</pre><pre>sudo apt-get install nginx</pre><h3>Step 2: Configure the firewall</h3><pre>sudo ufw app list</pre><p>it will list all the available applications</p><pre><strong>Output</strong></pre><pre>Available applications:<br>  Nginx Full<br>  Nginx HTTP<br>  Nginx HTTPS<br>  OpenSSH</pre><p>As you can see, there are three types of profiles available for Nginx:</p><ul><li><strong>Nginx Full</strong>: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)</li><li><strong>Nginx HTTP</strong>: This profile opens only port 80 (normal, unencrypted web traffic)</li><li><strong>Nginx HTTPS</strong>: This profile opens only port 443 (TLS/SSL encrypted traffic)</li></ul><p>Based on your requirements enable the available applications :</p><pre>sudo ufw allow &#39;Nginx HTTPS&#39;</pre><pre>Output:<br>Rule Updated</pre><h3>Step 3 — Check your Web Server</h3><p>At the end of the installation, ubuntu starts NGINX and it will be in running state</p><p>You can check it by typing this command:</p><pre>systemctl status nginx</pre><pre>Output:<br><strong>●</strong> nginx.service - A high performance web server and a reverse proxy server</pre><pre>Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en</pre><pre>Active: <strong>active (running)</strong> since Fri 2020-02-21 07:52:07 UTC; 5h 6min ago</pre><pre>Process: 28980 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5</pre><pre>Process: 28989 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (cod</pre><pre>Process: 28984 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process</pre><pre>Main PID: 28992 (nginx)</pre><pre>Tasks: 2</pre><pre>Memory: 2.3M</pre><pre>CPU: 62ms</pre><pre>CGroup: /system.slice/nginx.service</pre><pre>├─28992 nginx: master process /usr/sbin/nginx -g daemon on; master_pr</pre><pre>└─28993 nginx: worker process</pre><p>As you can see above, the service appears to have started successfully. However, the best way to test this is to actually request a page from Nginx.</p><p>When you have your server’s IP address, enter it into your browser’s address bar:</p><pre><a href="http://your_server_ip/">http://your_server_ip</a></pre><p>You will be seeing default page of NGINX</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*dUdwg6qW_UIIEZcwLLmuWA.png" /><figcaption>if this page comes NGINX is successfully installed</figcaption></figure><p><strong>Managing commands for Nginx</strong></p><p>To stop your web server, type:</p><pre>sudo systemctl stop nginx</pre><p>To start the webserver type:</p><pre>sudo systemctl start nginx</pre><p>To stop and then start the service again, type:</p><pre>sudo systemctl restart nginx</pre><p>If you are simply making configuration changes, type:</p><pre>sudo systemctl reload nginx</pre><p>To Disable NGINX type</p><pre>sudo systemctl disable nginx</pre><h3>Step 4 — Setting Up Server Blocks</h3><p>Nginx on Ubuntu has one server block enabled by default that is configured to serve documents out of a directory at /var/www/html.</p><p>In order for Nginx to serve this content, it’s necessary to create a server block with the correct directives. Instead of modifying the default configuration file directly, let’s make a new one at /etc/nginx/sites-available/name.com:</p><pre>sudo nano /etc/nginx/sites-available/example.com</pre><p>Paste in the following configuration block, which is similar to the default</p><pre>server {<br>        listen 80;<br>        listen [::]:80;</pre><pre>        root /var/www/name.com/html;<br>        index index.html index.htm index.nginx-debian.html;</pre><pre>        server_name name.com www.name.com;</pre><pre>        location / {<br>                try_files $uri $uri/ =404;<br>        }<br>}</pre><p>Next, let’s enable the file by creating a link from it to the sites-enabled directory, which Nginx reads from during startup:</p><pre>sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/</pre><p>To avoid a possible hash bucket memory problem that can arise from adding additional server names, it is necessary to adjust a single value in the /etc/nginx/nginx.conf file. Open the file:</p><pre>sudo nano /etc/nginx/nginx.conf</pre><pre>...<br>http {<br>    ...<br>    server_names_hash_bucket_size 64;<br>    ...<br>}<br>...</pre><p>Next, test to make sure that there are no syntax errors in any of your Nginx files:</p><pre>sudo nginx -t</pre><p>If there aren’t any problems, restart Nginx to enable your changes:</p><pre>sudo systemctl restart nginx</pre><p>Nginx should now be se</p><p>rving your domain name. You can test this by navigating to you domain name specified in server block.</p><h3>Step 5 — Setting Up SSL Certificate</h3><h4>Installing Certbot</h4><p>First, add the repository:</p><pre>sudo add-apt-repository ppa:certbot/certbot</pre><p>Press Enter to Accept</p><pre>sudo apt install python-certbot-nginx</pre><h4>Confirming Nginx’s Configuration</h4><p>Certbot needs to be able to find the correct server block in your Nginx configuration for it to be able to automatically configure SSL. Specifically, it does this by looking for a server_name directive that matches the domain you request a certificate for.</p><p>If you followed the server block set up step in the Nginx installation tutorial, you should have a server block for your domain at /etc/nginx/sites-available/example.com with the server_name directive already set appropriately.</p><p>Most third-party APIs Providers need SSL installed in the server. It is also possible to get an SSL certificate for IP addresses also .you just have to bind xip.io or nip.io domain with your server block.</p><p>Example:</p><pre>server {<br>        listen 80;<br>        listen [::]:80;</pre><pre>        root /var/www/name.com/html;<br>        index index.html index.htm index.nginx-debian.html;</pre><pre>        server_name 192.168.2.1.xip.io 192.168.2.1.nip.io;</pre><pre>        location / {<br>                try_files $uri $uri/ =404;<br>        }<br>}</pre><h4>Obtaining an SSL Certificate</h4><pre>sudo certbot --nginx -d 192.168.2.1.xip.io -d 192.168.2.1.nip.io</pre><p>This runs certbot with the --nginx plugin, using -d to specify the names we’d like the certificate to be valid for.</p><p>If that’s successful, certbot will ask how you’d like to configure your HTTPS settings.</p><pre>Output</pre><pre>Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.<br>-------------------------------------------------------------------------------<br>1: No redirect - Make no further changes to the webserver configuration.<br>2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for<br>new sites, or if you&#39;re confident your site works on HTTPS. You can undo this<br>change by editing your web server&#39;s configuration.<br>-------------------------------------------------------------------------------<br>Select the appropriate number [1-2] then [enter] (press &#39;c&#39; to cancel):</pre><p>Select your choice then hit ENTER.</p><p>After pressing you will be getting confirmation message that SSL certificate is installed successfully .you can test it by firing your domain name.</p><h3>Certbot Auto-Renewal</h3><p>The Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. You will not need to run Certbot again unless you change your configuration. You can test automatic renewal for your certificates by running this command:</p><pre>sudo certbot renew --dry-run</pre><pre>The command to renew certbot is installed in one of the following locations:</pre><ul><li>/etc/crontab/</li><li>/etc/cron.*/*</li><li>systemctl list-timers</li></ul><p>If you are facing some issue in installing certbot then you can refer this link ,</p><p>May this link help you to get solution .</p><p><a href="https://certbot.eff.org/lets-encrypt/ubuntuother-nginx">https://certbot.eff.org/lets-encrypt/ubuntuother-nginx</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=295360dcbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>