<?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 Anshul Dutt Sharma on Medium]]></title>
        <description><![CDATA[Stories by Anshul Dutt Sharma on Medium]]></description>
        <link>https://medium.com/@anshuldutt21?source=rss-917f21ba4fff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wjHMF07EUCVOsO7W5epDsg.jpeg</url>
            <title>Stories by Anshul Dutt Sharma on Medium</title>
            <link>https://medium.com/@anshuldutt21?source=rss-917f21ba4fff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 18:28:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anshuldutt21/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[The Elixir of dreams]]></title>
            <link>https://medium.com/@anshuldutt21/the-elixir-that-promises-life-648b26b52706?source=rss-917f21ba4fff------2</link>
            <guid isPermaLink="false">https://medium.com/p/648b26b52706</guid>
            <category><![CDATA[poetry]]></category>
            <dc:creator><![CDATA[Anshul Dutt Sharma]]></dc:creator>
            <pubDate>Wed, 09 Feb 2022 06:41:25 GMT</pubDate>
            <atom:updated>2022-02-09T06:43:20.060Z</atom:updated>
            <content:encoded><![CDATA[<p>At dawn, I walk with thousand lives,<br>all broken, bruised, and naive<br>towards the star calling to me<br>for it has the elixir that would heal me</p><p>I walk on sands of dune<br>smoldering by the sun, scorching at noon<br>against dusty winds sent by the gods of Anemoi’<br>into the belly of the sand monster to die</p><p>I steer the wheels of the vessel<br>to fight mighty waves, rough and ready to wrestle<br>amidst rumbling clouds and perpetual pitter-patter<br>in a night so dark even the sun might shatter</p><p>With bleeding legs and melting temple<br>I race to the star to get me that sample<br>that promised me the life I fantasized<br>of only happiness and pride</p><p>She stood there holding the golden kettle<br>A seducing face with narrow eyes so devil<br>One by one seated those who escaped death<br>alongside me, awaiting their turn in stealth</p><p>She gave them each a drop<br>which they swallowed, ‘bop’<br>At last, she walked to me with potion flooding out of the pot’s brink<br>Offering the enticing drop, they say only thy gods drink</p><p>Will I ever be the same, I ask<br>for before drinking I had to know the elixir’s task<br>It will remove all memory of pain you ever had, she said<br>and fill it with magical glimpses you never had</p><p>A life so beautiful you can only fathom in dreams<br>with no sorrow and remorse by any means<br>With agony, I threw the kettle<br>and raged I don’t want this life to settle</p><p>For pain is what makes me who today I am<br>and by only suffering can I find my purpose plan<br>And so I turned my back to that life of deception<br>and returned back to encounter me satan</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=648b26b52706" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Communications with a different flavour of randomness]]></title>
            <link>https://medium.com/img-iit-roorkee/secure-communications-with-a-different-flavour-of-randomness-a86b6db5d1da?source=rss-917f21ba4fff------2</link>
            <guid isPermaLink="false">https://medium.com/p/a86b6db5d1da</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Anshul Dutt Sharma]]></dc:creator>
            <pubDate>Sun, 15 Dec 2019 14:34:44 GMT</pubDate>
            <atom:updated>2019-12-16T11:49:40.446Z</atom:updated>
            <content:encoded><![CDATA[<h3>Secure communications with a different flavour of randomness</h3><blockquote>“One must acknowledge with cryptography no amount of violence will ever solve a math problem.”</blockquote><p>Cryptography has always been a fascinating field of study. The core idea of transferring a message between two parties without letting anyone else know what it is, is interesting at the least. A minimalistic approach that is also information-theoretically secure (unbreakable irrespective of computational power) is the One Time Pad which uses a pre-shared common secret key. The security depends on the secret key which has to be as secure as possible and as random as possible. The task of generating a secret key is one of the most difficult and crucial tasks as we not only need to create a random key but also need to make sure that it does not get hacked by a third party. Keeping all of this in mind, we created a secure connection using P2P communication to transmit messages using the famous Diffie-Hellman Algorithm in our project. The Diffie-Hellman Key Exchange is a secure key exchange protocol widely used in practical cryptographic applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*jxhGJK2y2-ywvJo7YD_SwQ.jpeg" /></figure><p><strong>Idea Behind The Algorithm</strong></p><p>Let us say <strong>Alice</strong> needs to send a secret message to <strong>Bob</strong> without letting <strong>Eve</strong> decipher the message. Before I begin, let me elucidate some notions of public keys and private keys. As the name suggests, a public key means publicly known. It is available to everyone. Likewise, a Private key is a confidential key known only to the owner.</p><p>So basically, the idea is that <strong>Alice</strong> and <strong>Bob</strong> decide two prime numbers, <strong>g</strong> and <strong>P</strong>, mutually and publicly, which can be referred to as Public Keys. Generally, <strong>g</strong> is a small prime number and <strong>P</strong> is taken large, usually 2000 or 4000 bits long. Now Alice decides a random number <strong>a</strong> which is private and not known to anybody including Bob. Similarly, Bob decides a random number say <strong>b</strong>, again private. I will later discuss a unique method that I implemented to decide the <strong>a</strong> and <strong>b</strong> with an appreciable level of randomness. After deciding on these keys, Alice performs an operation <strong><em>g^a mod </em>P</strong>, let’s call this <strong><em>A</em></strong> since it comes from <strong><em>a</em></strong>. Bob then performs<strong><em> g^b mod </em>P, </strong>which let’s call <strong><em>B</em></strong>. Alice then sends <strong><em>A</em></strong> to Bob, and Bob sends <strong><em>B</em></strong> to Alice. Finally, Alice takes <strong><em>B</em></strong> and performs<strong><em> B^a mod </em>P</strong>. Similarly, Bob takes <strong><em>A</em></strong> and performs <strong><em>A^b mod P</em></strong>. This results in the same number i.e. <strong><em>B^a mod P = A^b mod P = g^ab mod P</em></strong>. They now have a shared number which can be called as the secret key <strong>K</strong>. Keep in mind that <strong>K</strong> is the final secret key which is linked to the public keys <strong>g</strong> and <strong>P</strong>, while <strong>a</strong> and <strong>b</strong> are the private keys known only to the user. Note that Eve has access to <strong>g, P</strong>, <strong>A</strong> and <strong>B. </strong>The beauty of this algorithm is that in spite of knowing all the public keys it will be a hard job for a third-party (<strong>Eve</strong>, in this example) figuring out the key without the knowledge of <strong>a</strong> and <strong>b</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*VP888pKQEHcT2mYz" /></figure><p><strong>How we randomized the private keys using mouse movement</strong></p><p>Now that I have built the basic idea behind the Diffie-Hellman algorithm, let’s work on implementing it. But before we move on, there is still a big problem that needs to be addressed related to the selection of the private keys<strong> a</strong> and <strong>b. </strong>The<strong> </strong>private keys are generated by using algorithms depending on a parameter as random as possible, say the storage of the hard disk in bits, the temperature of the machine, etc. So, in our project, we generated <strong>a</strong> and <strong>b</strong> based on the mouse movements which can be considered as a random parameter. Generally, the random private keys are generated with random bits RNG or PRNG, which is although difficult, but can be attacked. Numbers are generated based on the position where the mouse changes horizontal or vertical direction. The script takes the coordinates of the mouse pointer in the 256 × 256 pixel field for the few seconds, and two random 8-bit numbers are generated based on the position where the mouse changes horizontal or vertical direction. Then, it concatenates them to produce a random number and combines it with a 16-bit computer-generated number using XOR operation to increase the level of randomness. This process happens every time a mouse changes its direction and the numbers generated keep on concatenating. Hence, we get a larger random number. This random number is our private key (<strong>a</strong> or <strong>b</strong>). As you can see this method results in a high degree of randomness and we can get a highly random number almost impossible for third party systems to guess.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FiG3UDBEiOfa1si2eUq%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2FiG3UDBEiOfa1si2eUq&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FiG3UDBEiOfa1si2eUq%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="402" frameborder="0" scrolling="no"><a href="https://medium.com/media/d186c6bc732f45a3bd6463d9efe0d434/href">https://medium.com/media/d186c6bc732f45a3bd6463d9efe0d434/href</a></iframe><p><strong>What to do after getting the keys?</strong></p><p>Now we have our Public and Private keys. The public keys being random prime numbers and the private keys being generated using the mouse movement algorithm described above. Note that the final secret key is <strong>K</strong> which is obtained after the completion of the algorithm i.e. <strong><em>g^ab mod P.</em></strong> The next step is an easy one. After receiving the secret key <strong>K</strong>, what we can do is to convert the message into hexadecimal or binary and XOR it with the Key <strong>K</strong> to use the One Time Pad.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/588bc0e0a3c9b724a4a765470585be40/href">https://medium.com/media/588bc0e0a3c9b724a4a765470585be40/href</a></iframe><p>The receiver can again XOR the XOR ‘ed message sent with the key. By converting it back to the text format he can obtain the message. We use the property of XOR</p><p><strong>M XOR K XOR K= M</strong></p><p>where M is the hexadecimal format of the message. This XOR operation has been proved to be secure since the probability of any bit being either 0 or 1 is 50% each.</p><p><strong>How to send the data between a Client &amp; a Server?</strong></p><p>The last thing left to do is creating a pathway between the users who want to communicate. Establishing a connection between the two systems can be done in a variety of ways. One way is to implement a Peer to Peer Connection (P2P) between the clients. <a href="https://www.wi-fi.org/discover-wi-fi/wi-fi-direct">Wi-Fi</a> direct (also known as peer-to-peer or P2P) allows an application to quickly find and interact with nearby devices, at a range beyond the capabilities of Bluetooth.</p><p>Sockets (aka socket programming) enable programs to send and receive data, <strong>bi-directionally</strong>, at any given moment. With streaming sockets, data can be sent or received at any time, which in this case can be the<strong> XORed message</strong> or parameters <strong>A</strong> &amp; <strong>B</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6109d7c065348d6bbf95b2418cedf59/href">https://medium.com/media/b6109d7c065348d6bbf95b2418cedf59/href</a></iframe><p>This code makes a socket object, and binds it to any<strong> localhost’s port </strong>(<strong>8080 </strong>in the case) as a <strong>socket server</strong>. When the client connects to this address with a socket connection, the server listens for data, and stores it in the “from_client” variable. The data here comprises of the private key <strong>A</strong> which is sent by the client<strong>. </strong>Next, the program logs the client data using “print”, and then sends the its private key <strong>B (<em>g^b mod </em>P</strong>)<strong> </strong>to the client. If the connection fails it prints the message ‘client disconnected’.</p><p>Let’s take a look at the client code that would interact with this server program.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82032e8fd45998046ac6f5818b8920c0/href">https://medium.com/media/82032e8fd45998046ac6f5818b8920c0/href</a></iframe><p>The client opens up a socket connection with the server, but <strong>only if the server program is currently running</strong>. The client simultaneously sends its private key <strong>A (<em>g^a mod </em>P) </strong>and receives the private key <strong>B</strong> it anticipates from the server. Finally, Both the client and the server perform the operation once again and likewise obtain the shared secret key <strong>K<em>(g^ab mod P)</em></strong></p><p>To test this out, we can use two terminal windows at the same time, one for establishing a server connection and the other for client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FfBJMztukadskQ9EBWYOJA.png" /><figcaption>Terminal window for executing the Socket Server code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aQHO04exxZ1s2lrP0nHt9g.png" /><figcaption>Terminal window for executing the Socket Client code</figcaption></figure><p>As shown in the windows both the client and the server get the final secret key <strong>K</strong>. Now, the client encodes the message using the key after converting it into the hexadecimal format (as shown in the code above) and sends it to the server who decrypts the encoded message by again XOR ing it and obtains the required message.</p><p>Done! You can now start <strong>streaming public keys and messages between clients and servers</strong> using socket programming.</p><p><strong>How to send data between 2 clients?</strong></p><p>Sending data <strong>between 2 or more client devices</strong> over the internet is tricky. Due to protections implemented by network security, not all devices connected to the world wide web have a publicly accessible internet protocol (IP) address. How do we achieve <strong>reliability</strong> and <strong>speed</strong> when transmitting <strong>peer-to-peer data</strong>?</p><p>One way to accomplish this is by using <strong>the server in the middle</strong>. Client devices using the internet can connect to a server with a public IP address (or a website domain). Then, this broker in the middle can pass messages routed to 1 or many clients.</p><p><strong>The Endless War between Encryption &amp; Decryption</strong></p><p>The history of decryption and encryption is a compelling one. It has included a constant battle between cryptographers (encryption) and cryptanalysts (decryption), with persistent attempts to break an existing cipher algorithm, followed by the creation of a new cipher algorithm to replace the broken one.<br>The same battle goes on today but with a greater emphasis on creating stronger and stronger keys, so a new key is ready and waiting whenever an existing key is hacked (or shows signs of weakening). This process is never-ending. With the growth of the internet and the evolution of computers and smartphones, the importance of day-to-day information security is no longer thought of as only a military or government concern. It’s a bigger idea which takes us into the never-ending battle of staying one step ahead of cybercriminals at every single point of time and to keep addressing the complex questions How can we stay one step ahead? What new deterrents are waiting in the shadows? To fall behind will mean the compromise of our data which will be the darkest hour in the history of information security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a86b6db5d1da" width="1" height="1" alt=""><hr><p><a href="https://medium.com/img-iit-roorkee/secure-communications-with-a-different-flavour-of-randomness-a86b6db5d1da">Secure Communications with a different flavour of randomness</a> was originally published in <a href="https://medium.com/img-iit-roorkee">IMG IIT Roorkee</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>