<?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: OmarDev100</title>
    <description>The latest articles on DEV Community by OmarDev100 (@omardev100).</description>
    <link>https://dev.to/omardev100</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%2F778298%2F5be38684-e783-4332-8e37-bf750aa7715f.png</url>
      <title>DEV Community: OmarDev100</title>
      <link>https://dev.to/omardev100</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/omardev100"/>
    <language>en</language>
    <item>
      <title>Introducing CodeGuard: The open-source tool to obfuscate your JavaScript or Python code</title>
      <dc:creator>OmarDev100</dc:creator>
      <pubDate>Wed, 22 Jun 2022 06:53:31 +0000</pubDate>
      <link>https://dev.to/omardev100/introducing-codeguard-the-open-source-tool-to-obfuscate-your-javascript-or-python-code-4k51</link>
      <guid>https://dev.to/omardev100/introducing-codeguard-the-open-source-tool-to-obfuscate-your-javascript-or-python-code-4k51</guid>
      <description>&lt;p&gt;&lt;strong&gt;P&lt;/strong&gt;robably most of us know that &lt;strong&gt;copying and pasting from GitHub, Stack Overflow, etc.&lt;/strong&gt; &lt;em&gt;doesn't&lt;/em&gt; make you a &lt;strong&gt;programmer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Also, &lt;strong&gt;it's not great for&lt;/strong&gt; &lt;em&gt;someone to steal your code&lt;/em&gt; and &lt;strong&gt;use it pretending that he made that code/script&lt;/strong&gt;, right?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here CodeGuard comes!&lt;/strong&gt; &lt;em&gt;The open-source tool to obfuscate your JavaScript or Python code in no time!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I got this inspiration?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Once upon a time&lt;/strong&gt;, I was creating an &lt;strong&gt;project which does really great thing including making meetings, etc.&lt;/strong&gt; and this idea came in my mind:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Why would I allow someone steal my code pretending that he wrote that script/code?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, I though why don't I make a code obfuscator to make my code hard to read and nearly impossible to understand? So, that's the beginning of &lt;strong&gt;&lt;a href="https://codeguard.tech"&gt;CodeGuard&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How did I make it? (Project workflow)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Once a user provides a link to the file, we recommend using &lt;a href="https://gist.github.com"&gt;&lt;em&gt;GitHub Gist&lt;/em&gt;&lt;/a&gt; because the project was made to be used with Gist, but it will work also if you give a direct link to the file like &lt;code&gt;https://example.com/myproject/main.py&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The user will be selecting either Python or JavaScript:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NH-8dpXJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1655798332965/e4aP95m-u.png%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NH-8dpXJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1655798332965/e4aP95m-u.png%2520align%3D%2522left%2522" alt="image.png" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upon the user selection, it will call the API located in &lt;code&gt;api.codeguard.tech&lt;/code&gt; providing 2 parameters, the code link in &lt;code&gt;link&lt;/code&gt; and the programming language in &lt;code&gt;lang&lt;/code&gt;, of course you would like to try to use the &lt;strong&gt;API&lt;/strong&gt; yourself, we will leave a guide below!&lt;/p&gt;

&lt;p&gt;As soon as the &lt;strong&gt;API has been called&lt;/strong&gt;, it will start getting the file and obfuscating it, as soon as the &lt;strong&gt;obfuscated file is ready, it will be automatically downloaded at the user side&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Note: &lt;strong&gt;For Python code, change the obfuscated code extension to &lt;code&gt;.pyo&lt;/code&gt; and use &lt;code&gt;python -O &amp;lt;file-name&amp;gt;.pyo&lt;/code&gt; to run the file!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What problems did I experience
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Making the back-end&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As &lt;strong&gt;I need to use JS/PY&lt;/strong&gt; to obfuscate, although they run at the client side, I am unable to run the script to obfuscate from client-side&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How will I host and make the API&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the help of Flask, I can make a API with pretty good functionalities which can help me in the project, and with the existence of Linode, I can host my API on a Linux server in the cloud!&lt;/p&gt;

&lt;h2&gt;
  
  
  The tech-stack I used + Why did I use it?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://nextjs.org/"&gt;Next.js&lt;/a&gt;&lt;/strong&gt; - &lt;em&gt;Making the front-end design of the website&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTML/CSS&lt;/strong&gt; - &lt;em&gt;Making front-end&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://javascript.com"&gt;JavaScript&lt;/a&gt;&lt;/strong&gt; - &lt;em&gt;Back-end, for e.g. modal (alert) and link validation&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://linux.org"&gt;Linux&lt;/a&gt; &lt;a href="https://ubuntu.com"&gt;Ubuntu&lt;/a&gt; (&lt;a href="https://linode.com"&gt;Linode&lt;/a&gt;)&lt;/strong&gt; - &lt;em&gt;Host the API&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://vercel.com"&gt;Vercel&lt;/a&gt;&lt;/strong&gt; - &lt;em&gt;Host the website&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://python.org"&gt;Python&lt;/a&gt; (&lt;a href="https://flask.palletsprojects.com/"&gt;Flask&lt;/a&gt;)&lt;/strong&gt; - &lt;em&gt;Used to make the API&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  API
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Use the API (hosted by us)
&lt;/h3&gt;

&lt;p&gt;It's really simple to use our API, in JavaScript, it only requires one line of code!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.codeguard.tech/?link=&amp;lt;code link here&amp;gt;&amp;amp;lang=&amp;lt;js or py&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.codeguard.tech/?link=https://gist.githubusercontent.com/Omar8345/1038a82e7db5f81d0722a4f2ab701924/raw/b213490f419b1d67de6a6a1647557934b97fc1ef/nicecode.js&amp;amp;lang=js
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Hosting the API on your machine
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Clone the repository on your local machine:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;git clone https://github.com/Omar8345/CodeGuard&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, head into &lt;code&gt;CodeGuard/API&lt;/code&gt; and open your favorite IDE, if you use &lt;strong&gt;Visual Studio Code&lt;/strong&gt;, just enter:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;code .&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;And it will open up &lt;strong&gt;VSC&lt;/strong&gt; in the folder, just run in the terminal the following command:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$env:FLASK_APP="__init__.py &amp;amp;&amp;amp; flask run"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You should see a local link, head into it or &lt;a href="http://127.0.0.1:5000/"&gt;http://127.0.0.1:5000/&lt;/a&gt; and you should find some kind of error, just simply ignore it, now add the &lt;code&gt;link&lt;/code&gt; and &lt;code&gt;lang&lt;/code&gt; parameters value and you should be good to go!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Made using &lt;a href="https://vercel.com"&gt;Vercel&lt;/a&gt; and &lt;a href="https://linode.com"&gt;Linode&lt;/a&gt; for the &lt;a href="https://hashnode.com"&gt;Hashnode&lt;/a&gt; X &lt;a href="https://linode.com"&gt;Linode&lt;/a&gt; &lt;em&gt;Hackathon&lt;/em&gt;!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My quote
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ht10JQto--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1655800348645/6a-GYYsTT.png%2520align%3D%2522left%2522" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ht10JQto--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1655800348645/6a-GYYsTT.png%2520align%3D%2522left%2522" alt="image.png" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Take your time - But don't mess up!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Take your time&lt;/strong&gt; in studying, even &lt;strong&gt;study like 72 hours&lt;/strong&gt;, but &lt;strong&gt;&lt;em&gt;take the full mark!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Links 🔗 - Try CodeGuard!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Omar8345/CodeGuard"&gt;GitHub Repo&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://nextjs.org"&gt;Next.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://codeguard.tech"&gt;CodeGuard&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Special thanks to Vedant Singhal
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Vedant&lt;/strong&gt; a developer in high school from &lt;strong&gt;India&lt;/strong&gt;! &lt;strong&gt;Vedant&lt;/strong&gt; helped me a lot in this project, so I would like to thank him here!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank you Vedant!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out Vedant on Social Media:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://github.com/Ved235"&gt;GitHub - Ved235&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://www.buymeacoffee.com/ved235"&gt;Buymeacoffee - Ved235&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://learnwithved.hashnode.dev/"&gt;Vedant's Blog&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  We would like to hear your feedback and suggestions in the comments below!
&lt;/h3&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>python</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
