<?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: Deepak Singh</title>
    <description>The latest articles on DEV Community by Deepak Singh (@techmesh).</description>
    <link>https://dev.to/techmesh</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%2F730084%2F3665a1bd-1900-4016-b55f-3fb6f38fe7d8.jpg</url>
      <title>DEV Community: Deepak Singh</title>
      <link>https://dev.to/techmesh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/techmesh"/>
    <language>en</language>
    <item>
      <title>The Nightmare of FinTech XML: handling FATCA &amp; CRS Schema v2.0 Without Going Crazy</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Sat, 14 Feb 2026 10:29:53 +0000</pubDate>
      <link>https://dev.to/techmesh/the-nightmare-of-fintech-xml-handling-fatca-crs-schema-v20-without-going-crazy-3ea3</link>
      <guid>https://dev.to/techmesh/the-nightmare-of-fintech-xml-handling-fatca-crs-schema-v20-without-going-crazy-3ea3</guid>
      <description>&lt;p&gt;If you’ve ever had to build a system to generate XML files for government tax portals, you know the pain.&lt;/p&gt;

&lt;p&gt;The IRS (for FATCA) and the OECD (for CRS) don't just want simple data dumps. They demand highly specific, nested XML structures validated against complex XSD schemas. And just to make it fun, they update these schemas (like the recent Schema v2.0) right when you think you're done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Technical Challenge&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building a FATCA CRS reporting engine in-house is a massive resource sink. You aren't just mapping fields; you are dealing with:&lt;/li&gt;
&lt;li&gt;Strict XSD Validation: If your &lt;code&gt;&amp;lt;ResCountryCode&amp;gt;&lt;/code&gt; isn't ISO-3166 compliant, the whole file fails.&lt;/li&gt;
&lt;li&gt;Conditional Logic: Reporting a Passive NFE requires a completely different XML tree structure than a Financial Institution.&lt;/li&gt;
&lt;li&gt;Encoding &amp;amp; Encryption: For FATCA Model 2, you need to AES-256 encrypt the payload and wrap it in a digital envelope for the IDES gateway.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Hard-Coding is a Trap&lt;/strong&gt;&lt;br&gt;
I’ve seen developers try to hack this together using simple string concatenation or basic XML libraries. It works for 10 records. It crashes for 10,000.&lt;/p&gt;

&lt;p&gt;The better approach? Offloading the heavy lifting.&lt;/p&gt;

&lt;p&gt;We built &lt;a href="https://novuscompliance.com/" rel="noopener noreferrer"&gt;Novus Compliance&lt;/a&gt; specifically to handle this "boring but critical" infrastructure layer. It acts as a bridge between raw data (SQL/Excel) and the strict regulatory formats required by the IRS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools for Devs&lt;/strong&gt;&lt;br&gt;
If you are currently debugging a rejected file, stop guessing. We released a free tool that might save your weekend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://novuscompliance.com/xml-validation-tool/" rel="noopener noreferrer"&gt;Free XML Validator Tool&lt;/a&gt;: Drop your generated file here to see exactly which line breaks the schema rules.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://novuscompliance.com/validate-giin/" rel="noopener noreferrer"&gt;GIIN Validator:&lt;/a&gt; Verify if a financial institution’s ID is actually registered and active.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't reinvent the wheel. Use tools that already handle the FATCA CRS compliance edge cases so you can focus on your core product logic.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hehllo: The Ultimate Alternative to Google Meet, Zoom, and Microsoft Teams</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Thu, 13 Jul 2023 15:34:11 +0000</pubDate>
      <link>https://dev.to/techmesh/hehllo-the-ultimate-alternative-to-google-meet-zoom-and-microsoft-teams-4dfi</link>
      <guid>https://dev.to/techmesh/hehllo-the-ultimate-alternative-to-google-meet-zoom-and-microsoft-teams-4dfi</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oZr8oc8T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_800%2Ch_450%2Cc_scale/f_auto%2Cq_auto/v1688976971/techmeshblog/hehllo-blog/hehllo-blog.jpg%3F_i%3DAA" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oZr8oc8T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_800%2Ch_450%2Cc_scale/f_auto%2Cq_auto/v1688976971/techmeshblog/hehllo-blog/hehllo-blog.jpg%3F_i%3DAA" alt="Alternative to Google Meet, Zoom, and Microsoft Teams" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the modern era of remote work and virtual meetings, video conferencing platforms have become essential tools for collaboration and communication. While giants like Google Meet, Zoom, and Microsoft Teams have dominated the market, a new contender has emerged to revolutionize the way we connect online.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the modern era of remote work and virtual meetings, video conferencing platforms have become essential tools for collaboration and communication. While giants like Google Meet, Zoom, and Microsoft Teams have dominated the market, a new contender has emerged to revolutionize the way we connect online. &lt;/p&gt;

&lt;h2&gt;
  
  
  Say hello to Hehllo
&lt;/h2&gt;

&lt;p&gt;A powerful platform that offers audio-video calling, in-app file sharing, screen sharing, and drawing or whiteboarding features, all at an incredibly affordable price of just $6 per year. &lt;/p&gt;

&lt;p&gt;In this blog, we will explore the features and benefits of Hehllo and understand why it is a worthy alternative to established players.&lt;/p&gt;

&lt;h1&gt;
  
  
  Signup Now
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://hehllo.com/"&gt;www.hehllo.com&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Power of Hehllo
&lt;/h2&gt;

&lt;p&gt;Hehllo offers a comprehensive set of features that make it a standout choice for video conferencing and collaboration. Let’s delve into each of these features and understand how they enhance the user experience.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KNgCaPSd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_386%2Cc_scale/f_auto%2Cq_auto/v1688975383/techmeshblog/hehllo/hehllo.png%3F_i%3DAA" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KNgCaPSd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_386%2Cc_scale/f_auto%2Cq_auto/v1688975383/techmeshblog/hehllo/hehllo.png%3F_i%3DAA" alt="Alternative to Google Meet, Zoom, and Microsoft Teams" width="760" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Audio-Video Calling
&lt;/h2&gt;

&lt;p&gt;Hehllo provides high-quality audio-video calling capabilities, allowing you to connect with colleagues, friends, or clients seamlessly. The platform ensures clear and uninterrupted communication, enabling effective virtual meetings regardless of geographical boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  In-App File Sharing
&lt;/h2&gt;

&lt;p&gt;Collaboration often involves sharing documents, images, or presentations. With Hehllo’s in-app patented file-sharing feature, you can easily exchange files without the need for external file-sharing services. This streamlines the workflow and keeps everything within the platform, making it convenient and efficient.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--owgnAUQA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_384%2Cc_scale/f_auto%2Cq_auto/v1688974766/techmeshblog/Fileshare/Fileshare.jpg%3F_i%3DAA" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--owgnAUQA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_384%2Cc_scale/f_auto%2Cq_auto/v1688974766/techmeshblog/Fileshare/Fileshare.jpg%3F_i%3DAA" alt="Alternative to Google Meet, Zoom, and Microsoft Teams" width="760" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Screen Sharing
&lt;/h2&gt;

&lt;p&gt;Screen sharing is a vital feature for effective presentations, demonstrations, or remote support. Hehllo enables users to share their screens with others effortlessly, allowing them to showcase their work, walk through presentations, or troubleshoot technical issues seamlessly. This feature facilitates real-time collaboration and enhances productivity during online meetings.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MdxdK4Mz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_384%2Cc_scale/f_auto%2Cq_auto/v1688974761/techmeshblog/ScreenShare/ScreenShare.jpg%3F_i%3DAA" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MdxdK4Mz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_384%2Cc_scale/f_auto%2Cq_auto/v1688974761/techmeshblog/ScreenShare/ScreenShare.jpg%3F_i%3DAA" alt="Alternative to Google Meet, Zoom, and Microsoft Teams" width="760" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Draw or Whiteboard
&lt;/h2&gt;

&lt;p&gt;Visual aids are often indispensable when explaining concepts or brainstorming ideas. Hehllo comes equipped with an intuitive drawing or whiteboarding feature, enabling participants to express their ideas visually. Whether it’s sketching diagrams, annotating documents, or simply doodling, this feature adds an interactive element to your virtual meetings.&lt;br&gt;
Apart from the above-mentioned features Hehllo (has) offers Snapshot, Recording, Audio/Video Mute &amp;amp; Unmute and Chat options.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XN0QGH3m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_384%2Cc_scale/f_auto%2Cq_auto/v1688974769/techmeshblog/Draw/Draw.jpg%3F_i%3DAA" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XN0QGH3m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/techmeshblog/images/w_760%2Ch_384%2Cc_scale/f_auto%2Cq_auto/v1688974769/techmeshblog/Draw/Draw.jpg%3F_i%3DAA" alt="Alternative to Google Meet, Zoom, and Microsoft Teams" width="760" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Uninterrupted Connection and Affordable Pricing
&lt;/h2&gt;

&lt;p&gt;One of the standout advantages of Hehllo is its unlimited connection time. Unlike some other platforms that limit meeting duration, Hehllo allows users to communicate for as long as they need without any time constraints. This is particularly beneficial for extended discussions, training sessions, (or) webinars, or for friends and families to just STAY connected. Furthermore, Hehllo’s pricing model is incredibly affordable, free for the first 3 months, &lt;strong&gt;with a yearly subscription costing just $6 thereafter&lt;/strong&gt;. This low cost makes it accessible to individuals, small businesses, and educational institutions alike, without compromising on quality or functionality. By offering an affordable solution, Hehllo opens doors for wider adoption, especially in scenarios where budget constraints may have been a barrier before. It shows what:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hehllo is truly all about connecting people.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Security and Privacy
&lt;/h2&gt;

&lt;p&gt;In an era of increasing concerns about data privacy and security breaches, Hehllo prioritizes the protection of user information. The platform employs robust encryption protocols to safeguard all communication and files exchanged during meetings. This ensures that sensitive information remains confidential and inaccessible to unauthorized individuals.&lt;br&gt;
Additionally, Hehllo follows industry-standard security practices, regularly updating its system and conducting security audits to identify and address any potential vulnerabilities. By adopting these measures, Hehllo aims to provide a safe and secure environment for its users to connect and collaborate without any worries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secure Browser-to-Browser Connection
&lt;/h2&gt;

&lt;p&gt;Security is of paramount importance in today’s digital landscape. Hehllo recognizes this and prioritizes the protection of user data and privacy. With Hehllo, you can enjoy peace of mind knowing that your video conferences and shared content are transmitted through a secure browser-to-browser connection. This eliminates the need for additional plugins or software installations, making it easy to set up and use Hehllo without compromising security.&lt;/p&gt;

&lt;p&gt;Hehllo’s browser-to-browser connection also ensures that your data remains encrypted, safeguarding it from potential threats or unauthorized access. This enhanced security measure makes Hehllo a reliable option for organizations that handle sensitive information and value data privacy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seamless Integration and User-Friendly Interface
&lt;/h2&gt;

&lt;p&gt;Hehllo understands the importance of integration with existing tools and platforms. The platform offers seamless integration with popular productivity applications and project management tools, enhancing workflow efficiency and ensuring a smooth transition for users.&lt;/p&gt;

&lt;p&gt;Moreover, Hehllo boasts a user-friendly interface, making it easy for both tech-savvy individuals and those who may be less familiar with technology to navigate the platform effortlessly. With a minimal learning curve, users can quickly adapt to Hehllo and maximize their productivity without wasting time on complex setups or configurations. Users can either connect with a name and email; or create their contacts so they may connect with a click.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Hehllo emerges as a compelling alternative to established video conferencing platforms like Google Meet, Zoom, and Microsoft Teams. With its rich feature set—including audio-video calling, in-app file sharing, screen sharing, and drawing or whiteboarding—Hehllo empowers users to connect, collaborate, and communicate seamlessly.&lt;/p&gt;

&lt;p&gt;The platform’s unlimited connection time and affordable pricing of just $6 per year, after offering the first 3 months for free, make it an attractive choice for individuals, businesses, and educational institutions alike. Hehllo’s commitment to security and privacy, coupled with its user-friendly interface and seamless integration capabilities, further solidifies its position as a versatile and reliable video conferencing solution.&lt;/p&gt;

&lt;p&gt;Whether you are a remote worker, a team manager, an educator, or simply someone looking for a user-friendly and affordable video conferencing platform, Hehllo offers a compelling package that deserves your attention. So, (delete – why not) it may be time to say goodbye to the limitations of the past and say hello to Hehllo—the future of virtual collaboration (delete – ?)!&lt;/p&gt;

&lt;p&gt;Zoom, Microsoft Teams, and Google Meet are trademarks of their respective owners.&lt;/p&gt;

</description>
      <category>googlemeet</category>
      <category>microfostteam</category>
      <category>zoom</category>
      <category>virtualmeeting</category>
    </item>
    <item>
      <title>How the future can be changed with Metaverse, Artificial Intelligence</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Tue, 04 Oct 2022 06:38:21 +0000</pubDate>
      <link>https://dev.to/techmesh/how-the-future-can-be-changed-with-metaverse-artificial-intelligence-26n3</link>
      <guid>https://dev.to/techmesh/how-the-future-can-be-changed-with-metaverse-artificial-intelligence-26n3</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vNHSMuca--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yfkujm5ygt4n5oicv2yu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vNHSMuca--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yfkujm5ygt4n5oicv2yu.jpg" alt="How the future can be changed with Metaverse, Artificial Intelligence" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Metaverse: The Future of Art and Artificial Intelligence&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the Metaverse?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Metaverse is a virtual world that exists on the internet. It is made up of many different virtual worlds, and users can travel between them.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How will the Metaverse be used in the future?
There is no one answer to this question, as the Metaverse will be used in a variety of ways in the future. Some people believe it will be used mainly for social networking and communication, while others believe it will be used for more business-oriented activities. There are also those who believe the Metaverse will be used for education and training, and for creating and experiencing virtual worlds. The possibilities are endless, and it will be interesting to see how the Metaverse evolves and is used in the years to come.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uO-X2W_d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orawgupzf41qgotu5lzx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uO-X2W_d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orawgupzf41qgotu5lzx.jpeg" alt="How the future can be changed with Metaverse, Artificial Intelligence" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the impact of artificial intelligence on the Metaverse?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Artificial intelligence is changing the Metaverse as we know it. With the advent of smarter-than-human AI, the Metaverse is becoming more and more populated with intelligent bots and avatars. This is having a profound impact on the way people socialize and do business in the metaverse.&lt;br&gt;
Some believe that the rise of AI is a good thing, as it is making the metaverse more intelligent and interesting. Others believe that the rise of AI is a bad thing, as it is making the Metaverse more artificial and less human. Regardless of which side of the debate you are on, it is clear that AI is having a significant impact on the Metaverse.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fxNQLA60--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvhj33i074xmxl7if209.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fxNQLA60--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvhj33i074xmxl7if209.jpg" alt="How the future can be changed with Metaverse, Artificial Intelligence" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the impact of the Metaverse on art?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Metaverse has had a significant impact on the art world. It has allowed artists to create and exhibit their work in a new and innovative way. It has also allowed them to reach a wider audience. In the future, the Metaverse will likely have an even greater impact on art. It is likely that more and more artists will create work specifically for the Metaverse, and that the Metaverse will become a major venue for the exhibition of art.&lt;br&gt;
The Metaverse has already had a significant impact on the way people experience art. By providing a virtual space where people can come together to appreciate art, the Metaverse has made it possible for people to appreciate art in a new and more meaningful way.&lt;/p&gt;

</description>
      <category>metaverse</category>
      <category>machinelearning</category>
      <category>ai</category>
      <category>web3</category>
    </item>
    <item>
      <title>Secure Web applications using CryptoJS and PHP</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Sat, 27 Nov 2021 10:23:44 +0000</pubDate>
      <link>https://dev.to/techmesh/secure-web-applications-using-cryptojs-and-php-hm9</link>
      <guid>https://dev.to/techmesh/secure-web-applications-using-cryptojs-and-php-hm9</guid>
      <description>&lt;p&gt;Encrypt data using JS on front end and decrypt using PHP on backend using AES encryption method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why to use this method&lt;/strong&gt;&lt;br&gt;
To prevent Man-in-the-middle (MITM) attacks. Maximum cyber attacks occur MITM attacks. It means the attacker can be seen (intercept) your data before the server receives it from your browser. What if the data we send is already encrypted on the browser itself and sent to the server. It is where the crypto-to-php method works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it&lt;/strong&gt;&lt;br&gt;
Just encrypt the data using the method below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CryptoJS.AES.encrypt(JSON.stringify(dataValue), TheSecret, {format: CryptoJSAesJson}).toString();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;dataValue&lt;/strong&gt; is your input value the &lt;strong&gt;TheSecret&lt;/strong&gt; is your secret key. You can use your custom random generated secret key, I have used time() for demo purposes. You can use PHP Encryption Methos for your custom secret key encryption and decryption.&lt;/p&gt;

&lt;p&gt;The method I used to achieve the purpose (just for demo purposes).&lt;br&gt;
Start with data encryption on Front-End&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var dt = new Date();
var TheSecret = "";
$(document).ready(function(e) {
    $.ajax({
        url:'libs/php/get_random_key.php',
        type:'POST',
        data:"dts="+dt.getTime(),
        success: function(responseAjx){
            TheSecret = responseAjx;
            console.log(TheSecret);
        }
    });
});
$('button[name="sub"]').click(function(e) {
    var dataValue = $('input[name="data"]').val();
    var enData = CryptoJS.AES.encrypt(JSON.stringify(dataValue), TheSecret, {format: CryptoJSAesJson}).toString();
    $.ajax({
        url:'libs/php/decrypt.php',
        type:'POST',
        data:'crypt='+enData,
        success: function(cryptResponse){
            console.log(cryptResponse);
        }
    });

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the JS Encryption and Decryption Library &lt;a href="https://github.com/deepaksingh1984/crypto-js-and-php/blob/master/libs/js/encryption.js"&gt;CryptoJS&lt;/a&gt; &amp;amp; &lt;a href="https://github.com/deepaksingh1984/crypto-js-and-php/blob/master/libs/js/aes-encryption.js"&gt;Method&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the get_random_key.php code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;session_start();
$sname = time();
$_SESSION['cryptPs'] = $sname;
echo $sname;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the decrypt.php code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;session_start();
$key = $_SESSION['cryptPs'];
include('aes-encryption.php');
if(isset($_POST)){
    echo cryptoJsAesDecrypt($key, $_POST["crypt"]);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the aes-encryption.php here &lt;a href="https://github.com/deepaksingh1984/crypto-js-and-php/blob/master/libs/php/aes-encryption.php"&gt;PHP AES Encryption&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Find details code here &lt;a href="https://github.com/deepaksingh1984/crypto-js-and-php"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>php</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Simple way to generate random string in PHP</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Fri, 26 Nov 2021 06:18:40 +0000</pubDate>
      <link>https://dev.to/techmesh/simple-way-to-generate-random-string-in-php-25gj</link>
      <guid>https://dev.to/techmesh/simple-way-to-generate-random-string-in-php-25gj</guid>
      <description>&lt;p&gt;While developing an application, sometimes it requires generating a random but unique string, e.g. &lt;strong&gt;Password Generator, CSRF token&lt;/strong&gt;, and many more.&lt;/p&gt;

&lt;p&gt;There are so many methods to generate random and unique strings in PHP. For Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rand();
uniqid();
bin2hex(random_bytes(20));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fshyuzpal9et2ewpjfbx7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fshyuzpal9et2ewpjfbx7.jpg" alt="Simple way to generate random string in PHP"&gt;&lt;/a&gt;&lt;br&gt;
But I prefer my way to generate a random string by using existing PHP functions and bit improvisation.&lt;br&gt;
Here is the function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function random_seed(){
  list($usec, $sec) = explode(' ', microtime());
  return $sec + $usec * 1000000;
}

function getRadomSeed(){
    mt_srand(random_seed());
    $prefix = substr(str_shuffle(str_repeat($x='abcNOPQRSTUVWXYZdefghijklmnopqrstuvwxyzABCDEFGHIJKLM', ceil(5/strlen($x)) )),1,5);
    $suffix = substr(str_shuffle(str_repeat($x='wxyzABCDEFGHIJKLMNOabcdefghijklmnopqrstuvPQRSTUVWXYZ', ceil(5/strlen($x)) )),1,5);
    $randval = mt_rand();
    if(strlen($randval) % 2 == 0){
        $random = $prefix.$randval.$suffix;
    }else if(strlen($randval) % 3 == 0){
        $random = $prefix.$suffix.$randval;
    }
    else{
        $random = $randval.$prefix.$suffix;
    }
    return $random;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$rd = getRadomSeed();
echo $rd;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just to be sure that this is not the only way to generate random strings in PHP. I am just sharing one of my ways to generate random strings.&lt;br&gt;
Happy Thanksgiving! 🦃&lt;/p&gt;

</description>
      <category>php</category>
      <category>security</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>WordPress - Minify CSS, HTML, JS files using PHP</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Tue, 09 Nov 2021 09:55:46 +0000</pubDate>
      <link>https://dev.to/techmesh/wordpress-minify-css-html-js-files-using-php-2pb9</link>
      <guid>https://dev.to/techmesh/wordpress-minify-css-html-js-files-using-php-2pb9</guid>
      <description>&lt;p&gt;As web developers or designers, we all have an enemy which is called Site Speed. There are so many ways to speed up your web page, we are going to discuss one of those ways. Minifying HTML, CSS &amp;amp; JavaScript.&lt;/p&gt;

&lt;p&gt;Minifying means removing redundant or unnecessary data such as spacing, well-named variables, and comments.&lt;/p&gt;

&lt;p&gt;The minified version of the code [HTML, CSS, JavaScript] is 48% smaller in general. In some cases, minification can reduce the file size by as much as 60%. For example, there's a 176 kb difference between the original and minified version of the jQuery/JavaScript library.&lt;/p&gt;

&lt;p&gt;It reduces web page load times and bandwidth usage on websites and improves website speed and accessibility.&lt;/p&gt;

&lt;p&gt;So, we are going to minify WordPress using a simple PHP function. Add below codes to your functions.php, if you are using a child theme add inside child-theme/functions.php.&lt;/p&gt;

&lt;p&gt;Step One Create a Class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class WP_HTML_Compression{
    protected $wp_compress_css = true;
    protected $wp_compress_js = true;
    protected $wp_info_comment = true;
    protected $wp_remove_comments = true;
    protected $html;
    public function __construct($html)
    {
        if (!empty($html)) {
            $this-&amp;gt;wp_parseHTML($html);
        }
    }
    public function __toString()
    {
        return $this-&amp;gt;html;
    }
    protected function wp_bottomComment($raw, $compressed)
    {
        $raw = strlen($raw);
        $compressed = strlen($compressed);
        $savings = ($raw - $compressed) / $raw * 100;
        $savings = round($savings, 2);
        return '&amp;lt;!--HTML compressed, size saved ' . $savings . '%. From ' . $raw . ' bytes, now ' . $compressed . ' bytes--&amp;gt;';
    }
    protected function wp_minifyHTML($html)
    {
        $pattern = '/&amp;lt;(?&amp;lt;script&amp;gt;script).*?&amp;lt;\/script\s*&amp;gt;|&amp;lt;(?&amp;lt;style&amp;gt;style).*?&amp;lt;\/style\s*&amp;gt;|&amp;lt;!(?&amp;lt;comment&amp;gt;--).*?--&amp;gt;|&amp;lt;(?&amp;lt;tag&amp;gt;[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'"&amp;gt;]+)*&amp;gt;|(?&amp;lt;text&amp;gt;((&amp;lt;[^!\/\w.:-])?[^&amp;lt;]*)+)|/si';
        preg_match_all($pattern, $html, $matches, PREG_SET_ORDER);
        $overriding = false;
        $raw_tag = false;
        $html = '';
        foreach ($matches as $token) {
            $tag = (isset($token['tag'])) ? strtolower($token['tag']) : null;
            $content = $token[0];
            if (is_null($tag)) {
                if (!empty($token['script'])) {
                    $strip = $this-&amp;gt;wp_compress_js;
                } else if (!empty($token['style'])) {
                    $strip = $this-&amp;gt;wp_compress_css;
                } else if ($content == '&amp;lt;!--wp-html-compression no compression--&amp;gt;') {
                    $overriding = !$overriding;
                    continue;
                } else if ($this-&amp;gt;wp_remove_comments) {
                    if (!$overriding &amp;amp;&amp;amp; $raw_tag != 'textarea') {
                        $content = preg_replace('/&amp;lt;!--(?!\s*(?:\[if [^\]]+]|&amp;lt;!|&amp;gt;))(?:(?!--&amp;gt;).)*--&amp;gt;/s', '', $content);
                    }
                }
            } else {
                if ($tag == 'pre' || $tag == 'textarea') {
                    $raw_tag = $tag;
                } else if ($tag == '/pre' || $tag == '/textarea') {
                    $raw_tag = false;
                } else {
                    if ($raw_tag || $overriding) {
                        $strip = false;
                    } else {
                        $strip = true;
                        $content = preg_replace('/(\s+)(\w++(?&amp;lt;!\baction|\balt|\bcontent|\bsrc)="")/', '$1', $content);
                        $content = str_replace(' /&amp;gt;', '/&amp;gt;', $content);
                    }
                }
            }
            if ($strip) {
                $content = $this-&amp;gt;wp_removeWhiteSpace($content);
            }
            $html .= $content;
        }
        return $html;
    }
    public function wp_parseHTML($html)
    {
        $this-&amp;gt;html = $this-&amp;gt;wp_minifyHTML($html);
        if ($this-&amp;gt;wp_info_comment) {
            $this-&amp;gt;html .= "\n" . $this-&amp;gt;wp_bottomComment($html, $this-&amp;gt;html);
        }
    }
    protected function wp_removeWhiteSpace($str)
    {
        $str = str_replace("\t", ' ', $str);
        $str = str_replace("\n",  '', $str);
        $str = str_replace("\r",  '', $str);
        $str = str_replace(" This function requires postMessage and CORS (if the site is cross domain).", '', $str);
        while (stristr($str, '  ')) {
            $str = str_replace('  ', ' ', $str);
        }
        return $str;
    }
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step Two call the functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function wp_html_compression_finish($html)
 {
    return new WP_HTML_Compression($html);
 }
 function wp_wp_html_compression_start()
 {
    ob_start('wp_html_compression_finish');
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Final step call Wp hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add_action('get_header', 'wp_wp_html_compression_start');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All to getherL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class WP_HTML_Compression{
    protected $wp_compress_css = true;
    protected $wp_compress_js = true;
    protected $wp_info_comment = true;
    protected $wp_remove_comments = true;
    protected $html;
    public function __construct($html)
    {
        if (!empty($html)) {
            $this-&amp;gt;wp_parseHTML($html);
        }
    }
    public function __toString()
    {
        return $this-&amp;gt;html;
    }
    protected function wp_bottomComment($raw, $compressed)
    {
        $raw = strlen($raw);
        $compressed = strlen($compressed);
        $savings = ($raw - $compressed) / $raw * 100;
        $savings = round($savings, 2);
        return '&amp;lt;!--HTML compressed, size saved ' . $savings . '%. From ' . $raw . ' bytes, now ' . $compressed . ' bytes--&amp;gt;';
    }
    protected function wp_minifyHTML($html)
    {
        $pattern = '/&amp;lt;(?&amp;lt;script&amp;gt;script).*?&amp;lt;\/script\s*&amp;gt;|&amp;lt;(?&amp;lt;style&amp;gt;style).*?&amp;lt;\/style\s*&amp;gt;|&amp;lt;!(?&amp;lt;comment&amp;gt;--).*?--&amp;gt;|&amp;lt;(?&amp;lt;tag&amp;gt;[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'"&amp;gt;]+)*&amp;gt;|(?&amp;lt;text&amp;gt;((&amp;lt;[^!\/\w.:-])?[^&amp;lt;]*)+)|/si';
        preg_match_all($pattern, $html, $matches, PREG_SET_ORDER);
        $overriding = false;
        $raw_tag = false;
        $html = '';
        foreach ($matches as $token) {
            $tag = (isset($token['tag'])) ? strtolower($token['tag']) : null;
            $content = $token[0];
            if (is_null($tag)) {
                if (!empty($token['script'])) {
                    $strip = $this-&amp;gt;wp_compress_js;
                } else if (!empty($token['style'])) {
                    $strip = $this-&amp;gt;wp_compress_css;
                } else if ($content == '&amp;lt;!--wp-html-compression no compression--&amp;gt;') {
                    $overriding = !$overriding;
                    continue;
                } else if ($this-&amp;gt;wp_remove_comments) {
                    if (!$overriding &amp;amp;&amp;amp; $raw_tag != 'textarea') {
                        $content = preg_replace('/&amp;lt;!--(?!\s*(?:\[if [^\]]+]|&amp;lt;!|&amp;gt;))(?:(?!--&amp;gt;).)*--&amp;gt;/s', '', $content);
                    }
                }
            } else {
                if ($tag == 'pre' || $tag == 'textarea') {
                    $raw_tag = $tag;
                } else if ($tag == '/pre' || $tag == '/textarea') {
                    $raw_tag = false;
                } else {
                    if ($raw_tag || $overriding) {
                        $strip = false;
                    } else {
                        $strip = true;
                        $content = preg_replace('/(\s+)(\w++(?&amp;lt;!\baction|\balt|\bcontent|\bsrc)="")/', '$1', $content);
                        $content = str_replace(' /&amp;gt;', '/&amp;gt;', $content);
                    }
                }
            }
            if ($strip) {
                $content = $this-&amp;gt;wp_removeWhiteSpace($content);
            }
            $html .= $content;
        }
        return $html;
    }
    public function wp_parseHTML($html)
    {
        $this-&amp;gt;html = $this-&amp;gt;wp_minifyHTML($html);
        if ($this-&amp;gt;wp_info_comment) {
            $this-&amp;gt;html .= "\n" . $this-&amp;gt;wp_bottomComment($html, $this-&amp;gt;html);
        }
    }
    protected function wp_removeWhiteSpace($str)
    {
        $str = str_replace("\t", ' ', $str);
        $str = str_replace("\n",  '', $str);
        $str = str_replace("\r",  '', $str);
        $str = str_replace(" This function requires postMessage and CORS (if the site is cross domain).", '', $str);
        while (stristr($str, '  ')) {
            $str = str_replace('  ', ' ', $str);
        }
        return $str;
    }
 }
 function wp_html_compression_finish($html)
 {
    return new WP_HTML_Compression($html);
 }
 function wp_wp_html_compression_start()
 {
    ob_start('wp_html_compression_finish');
 }
 add_action('get_header', 'wp_wp_html_compression_start');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conclusion:&lt;br&gt;
Instead of using plugins to minify simply add this function to your WordPress site and see the magic🏃‍♂️.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>php</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Calculate Distance between 2 Geo Locations in PHP MySQL</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Tue, 19 Oct 2021 15:36:46 +0000</pubDate>
      <link>https://dev.to/techmesh/calculate-distance-between-2-geo-locations-in-php-mysql-5agg</link>
      <guid>https://dev.to/techmesh/calculate-distance-between-2-geo-locations-in-php-mysql-5agg</guid>
      <description>&lt;p&gt;Geolocation serves in a multitude of contexts. In this internet era, everything is on the single palm. Various technology uses various methods to get geolocations and distance between two locations. &lt;br&gt;
We are going to use PHP MySQL as technology to calculate the distance between two geo coordinates.&lt;/p&gt;
&lt;h1&gt;
  
  
  How can I do that?
&lt;/h1&gt;
&lt;h1&gt;
  
  
  Using MySQL Query
&lt;/h1&gt;

&lt;p&gt;So, I have a table &lt;code&gt;geo_cord&lt;/code&gt; containing two fields &lt;code&gt;latitude&lt;/code&gt; and &lt;code&gt;longitude&lt;/code&gt; and I need to calculate the user input &lt;code&gt;distance&lt;/code&gt; in km with another user inputs &lt;code&gt;user_latitude&lt;/code&gt; and &lt;code&gt;user_longitude&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fvua1o2u94wn5kicrhgtu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvua1o2u94wn5kicrhgtu.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well! we need to write a query:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We need to find all results from Database within user input distance&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$distance = 50; // user input distance
$user_latitude = '26.826999'; // user input latitude
$user_longitude = '-158.265114'; // user input logtitude

$sql = "SELECT ROUND(6371 * acos (cos ( radians($user_latitude) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($user_longitude) ) + sin ( radians($user_latitude) ) * sin( radians( latitude ) ))) AS distance,geo_cord.* FROM geo_cord HAVING distance &amp;lt;= $distance";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To convert to miles, multiply by 3971.&lt;/li&gt;
&lt;li&gt;To convert to kilometers, multiply by 6373.&lt;/li&gt;
&lt;li&gt;To convert to meters, multiply by 6373000.&lt;/li&gt;
&lt;li&gt;To convert to feet, multiply by (3971 * 5280) 20914080.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are other methods to achieve the same result, but I prefer this simple method with less coding and quick result.&lt;/p&gt;

&lt;h1&gt;
  
  
  Using PHP
&lt;/h1&gt;

&lt;p&gt;I have found a formula in Wikipedia &lt;a href="https://en.wikipedia.org/wiki/Haversine_formula" rel="noopener noreferrer"&gt;Haversine formula&lt;/a&gt; which determines the great-circle distance between two points on a sphere given their longitudes and latitudes.&lt;/p&gt;

&lt;p&gt;So it also gives result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function distance($latitude1, $longitude1, $latitude2, $longitude2) { 
        $pi80 = M_PI / 180; 
        $lat1 *= $pi80; 
        $lon1 *= $pi80; 
        $lat2 *= $pi80; 
        $lon2 *= $pi80; 
        $r = 6372.797; // radius of Earth in km 6371
        $dlat = $lat2 - $lat1; 
        $dlon = $lon2 - $lon1; 
        $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlon / 2) * sin($dlon / 2); 
        $c = 2 * atan2(sqrt($a), sqrt(1 - $a)); 
        $km = $r * $c; 
        return round($km); 
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;There are simple methods to achieve complex challenges. We just need to convert all challenges into opportunities. 😋&lt;/p&gt;

&lt;p&gt;NOTE: &lt;em&gt;NOTE: The map image is only for example purpose. It is not actual output.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>webdev</category>
      <category>php</category>
      <category>sql</category>
    </item>
    <item>
      <title>Secure Your Data with AES 256 bit Encryption and Decryption method using PHP</title>
      <dc:creator>Deepak Singh</dc:creator>
      <pubDate>Tue, 19 Oct 2021 09:08:18 +0000</pubDate>
      <link>https://dev.to/techmesh/secure-your-data-with-aes-256-bit-encryption-and-decryption-method-using-php-343n</link>
      <guid>https://dev.to/techmesh/secure-your-data-with-aes-256-bit-encryption-and-decryption-method-using-php-343n</guid>
      <description>&lt;p&gt;So today let’s discuss another method of data encryption and decryption using PHP AES-256-CBC and OpenSSL to cipher[encryption] and decipher[decryption] any string in the PHP.&lt;/p&gt;

&lt;p&gt;Encryption is a common method to protect data in the cyber world, which converts plain text into a long ciphertext constructed with random alphanumeric characters.&lt;/p&gt;

&lt;p&gt;We are using AES Advanced Encryption Standard with 256 bits key length. The following image shows how symmetric key encryption works:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fu524v6n4bkbdffcubcjv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fu524v6n4bkbdffcubcjv.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Let’s see the main recipe of the topic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class secureToke
{
    private static $secretKey = 'Your Desired key(Alphanumeric)';
    private static $secretIv = 'www.domain.com';
    private static $encryptMethod = "AES-256-CBC";
    public static function tokenencrypt($data)
    {
        $key = hash('sha256', self::$secretKey);
        $iv = substr(hash('sha256', self::$secretIv), 0, 16);
        $result = openssl_encrypt($data, self::$encryptMethod, $key, 0, $iv);
        return $result = base64_encode($result);
    }
    public static function tokendecrypt($data)
    {
        $key = hash('sha256', self::$secretKey);
        $iv = substr(hash('sha256', self::$secretIv), 0, 16);
        $result = openssl_decrypt(base64_decode($data), self::$encryptMethod, $key, 0, $iv);
        return $result;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Encryption method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$tokenencrypt = secureToken::tokenencrypt($token);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Decryption method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$tokendecrypt = secureToken::tokendecrypt($encryptedtoken);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! it’s done… Now you can encrypt your entire data on the webspace and make them secure. 🙂&lt;/p&gt;

</description>
      <category>php</category>
      <category>security</category>
      <category>webdev</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
