<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Raul Bolivar Navas</title>
    <description>The latest articles on DEV Community by Raul Bolivar Navas (@rasysbox).</description>
    <link>https://dev.to/rasysbox</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1291519%2F70fb3d38-9792-44a0-b044-364a75a0c12e.jpeg</url>
      <title>DEV Community: Raul Bolivar Navas</title>
      <link>https://dev.to/rasysbox</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rasysbox"/>
    <language>en</language>
    <item>
      <title>Authentication Flow and symmetric keys</title>
      <dc:creator>Raul Bolivar Navas</dc:creator>
      <pubDate>Thu, 13 Feb 2025 21:10:38 +0000</pubDate>
      <link>https://dev.to/rasysbox/authentication-flow-and-symmetric-keys-3iij</link>
      <guid>https://dev.to/rasysbox/authentication-flow-and-symmetric-keys-3iij</guid>
      <description>&lt;p&gt;Frontend and Backend are separated by two concepts but they are united by their interdependence, while the backend remains secure behind an infrastructure, perhaps a cloud like an &lt;em&gt;S3&lt;/em&gt; or a &lt;em&gt;VPS&lt;/em&gt; and even in containers like &lt;em&gt;EKS&lt;/em&gt; or &lt;em&gt;AKS&lt;/em&gt; etc. &lt;/p&gt;

&lt;p&gt;The frontend starts from the same point and when consulted by a client perhaps thousands of kilometers away over the Internet, the frontend is rendered on the client's machine obtaining the static files and the basic parameters to interact with the backend.&lt;/p&gt;

&lt;p&gt;In this sense, a solution that is continually accepted and widely used for many connections such as &lt;em&gt;SSH&lt;/em&gt;, &lt;em&gt;SFTP&lt;/em&gt; is the concept of symmetric keys (public/private).&lt;/p&gt;

&lt;p&gt;This concept is shown in the following figure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa7789svj4r8xyf8nfl7f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa7789svj4r8xyf8nfl7f.png" alt="simmetric-keys" width="710" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the client (rendered frontend) sends data through forms such as this case a login/register, the data previously on the client's computer is encrypted with the public key which, as indicated, is publicly distributed.&lt;/p&gt;

&lt;p&gt;This encrypted data flow travels through either &lt;em&gt;HTTP&lt;/em&gt; or HTTPS (the latter recommended for security), adding a second value to the security of the information provided by a client.&lt;/p&gt;

&lt;p&gt;This concept allows you to survive &lt;em&gt;Man-In-The-Middle&lt;/em&gt; techniques, solving a second-instance vulnerability associated with the capture of sensitive data such as credentials, email, credit card numbers, among others.&lt;/p&gt;

&lt;p&gt;In the following figure I show an authentication flow for login/register that allows data to be encrypted on the client using the public key. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft33nojwz29n8yqy7ms6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft33nojwz29n8yqy7ms6p.png" alt="simmetric-keys-login" width="800" height="579"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This data travels through the medium, in this case the Internet, from a remote site to the backend, being secured by both &lt;em&gt;HTTPS&lt;/em&gt; and &lt;em&gt;encryption&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;When it reaches the backend, this data is decrypted by it using the private key, which is only known to the backend's secured services.&lt;/p&gt;

&lt;p&gt;I share a repository on GitHub with code in Nest.JS and Spring Boot Java for your observation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/raulrobinson/symmetric-keys" rel="noopener noreferrer"&gt;https://github.com/raulrobinson/symmetric-keys&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;@Author:&lt;/em&gt; Raul Bolivar Navas&lt;br&gt;
&lt;em&gt;Email:&lt;/em&gt; &lt;a href="mailto:rasysbox@hotmail.com"&gt;rasysbox@hotmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>springboot</category>
      <category>nestjs</category>
      <category>fullstack</category>
    </item>
  </channel>
</rss>
