<?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 Mohammad numan on Medium]]></title>
        <description><![CDATA[Stories by Mohammad numan on Medium]]></description>
        <link>https://medium.com/@ciphernova?source=rss-da3d8ae8e4e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6CLQzxO8NNep3R3zlg-rgw.png</url>
            <title>Stories by Mohammad numan on Medium</title>
            <link>https://medium.com/@ciphernova?source=rss-da3d8ae8e4e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 06:27:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ciphernova/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[What is a vanity address and how to generate one?]]></title>
            <link>https://medium.com/@ciphernova/what-is-a-vanity-address-and-how-to-generate-one-f3d3348e34de?source=rss-da3d8ae8e4e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3d3348e34de</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[bitcoin-addresses]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[vanity-address]]></category>
            <dc:creator><![CDATA[Mohammad numan]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 18:02:08 GMT</pubDate>
            <atom:updated>2024-02-04T18:05:11.146Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WEPDXw8dfHYugl3pdkwEw.png" /></figure><h3>What is an address?</h3><p>A blockchain address is a unique sequence of numbers and letters. They serve as the digital equivalent of a physical address and allow for secure and efficient transactions in the decentralized environment of the blockchain.</p><p>They are typically represented by a string of alphanumeric characters, and each blockchain has its own format for addresses. For example, Bitcoin addresses start with a 1 or 3, Ethereum addresses start with 0x etc.</p><p>One of the key features of blockchain addresses is their transparency. All transactions made to and from a blockchain address are publicly visible on the blockchain ledger, providing a clear trail of all the transactions associated with that address. This level of transparency and accountability is one of the key factors that makes blockchain technology so secure and trustworthy.</p><p>In this article, we will only be focussing on Ethereum addresses which are of two types:-</p><ol><li><strong>Externally owned addresses (EOAs)</strong></li></ol><p>Externally Owned Address is controlled by an individual and used for regular transactions.</p><p>2. <strong>Contract addresses</strong></p><p>Contract Address is generated when a smart contract is deployed on the Ethereum blockchain.</p><h3>What is a vanity address?</h3><p>When navigating a blockchain explorer such as Etherscan, you often encounter intriguing addresses, exemplified by the images below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMLaLmSlU2HBHt5SfSzr5A.png" /><figcaption>1inch Token (src: <a href="https://etherscan.io/token/0x111111111117dc0aa78b770fa6a738034120c302">https://etherscan.io</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lRb2Dmuy8eLAeKzrpKIYbw.png" /><figcaption>Chi Token (src: <a href="https://etherscan.io/address/0x0000000000004946c0e9F43F4Dee607b0eF1fA1c">https://etherscan.io</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBSr1xyS9sRNV5nS5QrsQA.png" /><figcaption>Balancer Token (src: <a href="https://etherscan.io/token/0xba100000625a3754423978a60c9317c58a424e3d">https://etherscan.io</a>)</figcaption></figure><p>These addresses are specially generated using brute force, giving your wallet a unique touch as it can tie in your name or any other word you might want as part of your wallet address.</p><blockquote><strong>Vanity addresses are normal addresses, with the same functionality as any other, they only contain a custom alphanumeric character string, a message or a special word</strong> for its owner.</blockquote><h3>How is an address generated?</h3><p>To understand how an address is generated on Ethereum, let’s first understand what public-key cryptography is.</p><p><strong>Public-key cryptography</strong></p><p>Ethereum and most of the blockchains use Public-Key Cryptography (PKC). In comparison with symmetric encryption, Public-Key Cryptography is a method of asymmetric encryption. Instead of using only one key to decrypt data, <strong>it uses two separate keys </strong>i.e. public and private keys.</p><p>PKC was first used primarily to encrypt and decrypt messages in traditional computing. Cryptocurrencies now use this technology to encrypt and decrypt transactions.</p><p>The entire process of creating a wallet address starts with the creation of private keys. These keys then generate the public keys and the wallet addresses, too.</p><p><strong>Private key</strong></p><p>A private key gives you the ability to prove ownership or spend the funds associated with your public address.</p><p>A private key is a randomly generated hexadecimal 256-bit number which is astronomically large, and it’s large for a good reason. The randomly picked decimal number is further randomized by the algorithm and shortened to a usable length of 64 digits in a hexadecimal number format.</p><p><strong>Public key</strong></p><p>A public key allows you to receive cryptocurrency transactions. It’s a cryptographic code that’s paired to a private key. While anyone can send transactions to the public key, you need the private key to “unlock” them and prove that you are the owner of the cryptocurrency received in the transaction.</p><p>A public key derives from a private key and connects mathematically to it. The generation of a public key is calculated by using elliptic curve multiplication.</p><p>Elliptic curve multiplication (ECDSA, or Elliptic Curve Digital Signature Algorithm) is a mathematical process where the private key multiplies by a variable in an elliptic curve to produce an output. This output is another variable (the public key). We can only do this process in one way, from the private key to the public key. But it is nearly impossible to reverse this calculation.</p><p><strong>Public address</strong></p><p>The public address is the last 20 bytes of the keccack256 of the public key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HOcHezfoZ1QBtfNFNHj9Hg.jpeg" /><figcaption>Address generation flow</figcaption></figure><h3>Generating a vanity address</h3><p>To generate a vanity address, we will simply rely on brute force. Following will be the steps to achieve it:-</p><ol><li>Generate a random private key</li></ol><pre>const {randomBytes} = require(&quot;node:crypto&quot;);<br>let privateKey = randomBytes(32).toString(&quot;hex&quot;);</pre><p>We will use the crypto package (which comes pre-installed with node) to generate a random 32-byte string and then convert it into a hexadecimal string.</p><p>2. Get the corresponding address of the private key</p><pre>const privateKeyToAddress = require(&quot;ethereum-private-key-to-address&quot;);<br>let address = privateKeyToAddress(privateKey);</pre><p>To generate the address corresponding to a private key, we will use the “ethereum-private-key-to-address” package.</p><p>3. Check if the prefix of the address matches our custom prefix</p><p>We will repeat steps 1–3 until we find an address that matches our requirements.</p><p>Depending on the number of letters that you want to obtain in the address, the generation process will be very fast or very delayed. With each character that is added, the difficulty of the generator to find the desired pattern will increase. In addition to the difficulty of the pattern, in the generation of a vanity address, the power and speed of your equipment also have a significant influence.</p><p>The Node.js script for generating a vanity address will look something like this,</p><pre>const {randomBytes} = require(&quot;node:crypto&quot;);<br>const privateKeyToAddress = require(&quot;ethereum-private-key-to-address&quot;);<br>const readlineSync = require(&quot;readline-sync&quot;);<br><br>function getRandomWallet() {<br>    try {<br>        let privateKey = randomBytes(32).toString(&quot;hex&quot;);<br>        let address = privateKeyToAddress(privateKey);<br><br>        return {privateKey, address};<br>    } catch (error) {<br>        throw error<br>    }<br>}<br><br>(async () =&gt; {<br>    try {<br>        let prefix = readlineSync.question(&quot;Enter the prefix: &quot;);<br><br>        let triedCount = 1, wallet = getRandomWallet();<br>        while (true) {<br>            if (wallet.address.toLowerCase().startsWith(prefix.toLowerCase())) {<br>                console.log({<br>                    address: wallet.address,<br>                    privateKey: wallet.privateKey,<br>                    triedCount: triedCount<br>                })<br>                break;<br>            }<br>            wallet = getRandomWallet();<br>            triedCount++;<br>        }<br>    } catch (error) {<br>        console.log(error);<br>        process.exit(1);<br>    }<br>})();</pre><p>Let’s run this script and generate our first vanity address,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNSdjxlPerV2mlZrOq0rSA.png" /></figure><blockquote>Tip: Boost the speed of generating personalized Ethereum addresses by leveraging your GPU. With this specialized <a href="https://github.com/cenut/vanity-eth-gpu">github repository</a>, you can swiftly create an 8-character prefix address in around 24 seconds (with GTX 1070 OC GPU)</blockquote><p>Congratulations on successfully generating your first vanity address! You can try importing this wallet into your metamask and check if the address has the custom prefix.</p><ol><li>Click on the “Add account or hardware wallet” button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*ABasmA6LLYnFBUun4Jnbaw.png" /></figure><p>2. Select the “Import account” option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*Y6XmFyJ9o_Rwt31v3QtcMw.png" /></figure><p>3. Enter the private key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*Q_ef_elRDlNJ0yoVQ_nUuA.png" /></figure><p>4. As you can see, the wallet address has the prefix “0xc0de”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*1S2OEYkrrU3L1v3IumSA2w.png" /></figure><p>If you’re eager to delve deeper into the world of blockchain, I recommend creating a script for generating a vanity contract address.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3d3348e34de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create an IP rotation server using Nginx]]></title>
            <link>https://medium.com/@ciphernova/create-an-ip-rotation-server-using-nginx-ab35e9218da6?source=rss-da3d8ae8e4e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab35e9218da6</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[proxy-server]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Mohammad numan]]></dc:creator>
            <pubDate>Thu, 01 Feb 2024 14:14:57 GMT</pubDate>
            <atom:updated>2024-02-01T18:18:51.925Z</atom:updated>
            <content:encoded><![CDATA[<h3>Create an IP rotation proxy using Nginx</h3><h4>Creating an IP rotation proxy involves configuring a system to change its public IP address dynamically.</h4><h4>What is an IP address?</h4><p>An IP address is a unique address that identifies a device on the internet or a local network. IP stands for “Internet Protocol,” which is the set of rules governing the format of data sent via the Internet or local network.</p><p>You can check the IP address of your machine (or your router, if you are connected to the internet using wifi) by going to <a href="https://jsonip.com/">https://jsonip.com/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Q_medfa4OmvE7aXW1tajKw.png" /><figcaption>This will be the IP address of your machine (or your router if you are connected to the internet using wifi).</figcaption></figure><h4>How is your IP address used by various applications?</h4><p>Websites use your IP address for diverse purposes, such as geolocation to provide localized content and targeted advertisements, enhancing security measures by identifying potential threats, and facilitating analytics for traffic patterns and user behavior.</p><p>Websites also use IP addresses for access control by allowing or denying entry based on the source. They also employ IP tracking to monitor and identify potential malicious activities, helping prevent unauthorized access, spam, or other forms of abuse on the site.</p><h4>What is IP rotation?</h4><p>IP rotation proxy allows you to change your IP address periodically or randomly to access more data and content online, enhance your privacy and security, and avoid being blocked or detected by websites.</p><p>In this article, we will be creating a proxy rotation server from scratch. You will need the following resources:</p><ol><li>AWS (or any other cloud provider) account</li></ol><p>Let&#39;s start by creating 3 virtual machine instances. You don&#39;t need a beefy machine for proxies, so you can opt for minimum specs. For a better understanding of our setup, look at the picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aAPjEehgvJ_OuPOKmbBWUg.png" /><figcaption>Server Architecture</figcaption></figure><p>“Server1” will be acting as a load balancer which will be diverting the requests to the other two proxies, i.e., “Server2” and “Server3”. “Server2” and “Server3” will be acting as forward proxies which will forward the incoming requests to the requested resources.</p><p>Luckily, We can configure nginx to act as a load balancer as well as a forward proxy.</p><h4>Installing Nginx</h4><p>We need to use Nginx on all our 3 servers, so let&#39;s begin by installing it.</p><ol><li>First, let&#39;s begin by logging into our server using SSH. To do this, run the following command from your terminal:</li></ol><pre>sudo ssh username@serverip</pre><p>2. To install nginx, run the following commands:</p><pre>sudo apt update<br>sudo apt install nginx</pre><p>3. Check if Nginx was installed correctly and is running by running the following command.</p><pre>sudo systemctl status nginx</pre><p>You should get output that looks something like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*evEnVQJ_Pnv3ywEVFx0FIA.png" /></figure><p>4. By default, nginx is configured as a reverse proxy. We need to configure nginx to run as a forward proxy on “Server2” and “server3” and as a load balancer on “Server1”.</p><h4>Configuring Nginx as a forward proxy</h4><p>To run Nginx as a forward proxy, locate your configuration file for Nginx and make the following changes to it:</p><blockquote>By default, configuration file for nginx is located at: <strong>/etc/nginx/sites-enabled/default</strong></blockquote><ol><li>To open the configuration file for Nginx,</li></ol><pre>sudo nano /path/to/nginx/config/file</pre><p>2. Remove anything written in the file and paste the following text into the file:</p><pre>server {<br>    listen 3001;<br> <br>    resolver 8.8.8.8;<br><br>    location / {<br><br>         proxy_pass http://$host;<br>         proxy_set_header Host $host;<br>    }<br>}</pre><p>This will configure Nginx as a forward proxy server running on port 3001 which will forward all the incoming requests to the requested resource. The<em> ‘resolver 8.8.8.8’</em> directive specifies which nameservers should be used to resolve the names of upstream servers into addresses, in this case, 8.8.8.8 corresponds to Google’s nameservers.</p><blockquote>You might need to open port 3001 if it is not open by default. You could do this from the cloud provider console. If ufw is also enabled on your server, you will need to open the port from ufw also by running the following command on the terminal: <strong>sudo ufw allow 3001</strong></blockquote><p>3. Next, test to make sure that there are no syntax errors in any of your Nginx files:</p><pre>sudo nginx -t</pre><p>4. If there aren’t any problems, restart Nginx to enable your changes:</p><pre>sudo systemctl restart nginx</pre><p>Make sure to do this on both “Server2” and “Server3”.</p><h4>Configuring Nginx as a load balancer</h4><ol><li>To configure Nginx on “Server1” as a load balancer, paste the following text into your Nginx config file:</li></ol><pre>upstream proxy {<br>    server server2-ip:3001;  #update your server2 ip here<br>    server server3-ip:3001;  #update your server3 ip here<br>}<br><br>server {<br>    listen 80 default_server;<br>    listen [::]:80 default_server;<br>    root /var/www/html;<br><br>    location / {<br>      proxy_pass http://proxy;<br>      proxy_set_header X-Real-IP $remote_addr;<br>      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>      proxy_set_header X-Forwarded-Proto $scheme;<br>      proxy_set_header Host $host;<br>    }<br>}</pre><p>In this configuration, Nginx assigns equal weights to both the forward proxies by default, meaning, the requests will be diverted equally to both servers. We can also assign custom weights to the proxies to redirect the requests unequally.</p><p>2. Next, test to make sure that there are no syntax errors in any of your Nginx files:</p><pre>sudo nginx -t</pre><p>3. If there aren’t any problems, restart Nginx to enable your changes:</p><pre>sudo systemctl restart nginx</pre><blockquote>Optional: You could also register a domain which you can use to mask the “Server1” IP address.</blockquote><h4>Testing the IP rotation proxy</h4><p>Now, let’s validate our configured IP rotation setup by implementing a test using a Node.js script. This script will make requests to an IP address API, such as <a href="https://jsonip.com/">https://jsonip.com</a>, which returns the source IP address for each request. Our expectation is that, with each subsequent request, the IP address should change according to our IP rotation setup. The sequence would look like this:</p><ul><li>Request 1 =&gt; Server 2 IP</li><li>Request 2 =&gt; Server 3 IP</li><li>Request 3 =&gt; Server 2 IP</li><li>Request 4 =&gt; Server 3 IP</li><li>…</li></ul><p>This test will confirm the successful implementation of IP rotation, where the script’s requests are distributed among the configured servers, resulting in a changing source IP for each request.</p><p>Let&#39;s run the following Node.js script:</p><pre>const axios = require(&quot;axios&quot;);<br>;<br><br>(async () =&gt; {<br>    try {<br>        let resp = null, reqCounter = 1;<br><br>        while (true) {<br>            resp = await axios.get(&quot;https://jsonip.com&quot;, {<br>                proxy: {<br>                    protocol: &quot;http&quot;,<br>                    host: &quot;server1-ip&quot;, //update your server1 ip here<br>                    port: 80<br>                }<br>            })<br><br>            console.log({<br>                reqNumber: reqCounter,<br>                ip: resp.data.ip,<br>            })<br><br>            reqCounter++;<br>        }<br>    } catch (error) {<br>        console.log(error);<br>        process.exit(1);<br>    }<br>})();</pre><p>We get the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*ssP2Ow8lafFdNLvlPD6AMg.png" /><figcaption>The IP rotates with each request.</figcaption></figure><p>If the script output reflects a sequence of changing IP addresses, such as above, congratulations! You have successfully created a proxy rotation server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab35e9218da6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>