<?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 Chavindu Jayawardana on Medium]]></title>
        <description><![CDATA[Stories by Chavindu Jayawardana on Medium]]></description>
        <link>https://medium.com/@chavindujayawardhana?source=rss-d03893227365------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qx6BVvMpbD0hNmwVyt95IQ.png</url>
            <title>Stories by Chavindu Jayawardana on Medium</title>
            <link>https://medium.com/@chavindujayawardhana?source=rss-d03893227365------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:01:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chavindujayawardhana/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[I Built an Android Keyboard That Turns Any Language Into English. It Needs No Server.]]></title>
            <link>https://medium.com/@chavindujayawardhana/i-built-an-android-keyboard-that-turns-any-language-into-english-it-needs-no-server-99f403e511a9?source=rss-d03893227365------2</link>
            <guid isPermaLink="false">https://medium.com/p/99f403e511a9</guid>
            <dc:creator><![CDATA[Chavindu Jayawardana]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 18:06:08 GMT</pubDate>
            <atom:updated>2026-10-23T18:06:08.385Z</atom:updated>
            <content:encoded><![CDATA[<p>By Chavindu Jayawardana</p><p>I type “mama gedara yanawa” and my phone turns it into “I’m going home.”</p><p>That is Liyora, a free Android keyboard I built. You type in Sinhala, in Singlish (Sinhala written with English letters), or in another language. You tap one key and get clear English. Many people think in their own language and lose time searching for the right English words. I wanted to fix that, with no server and no subscription.</p><p>This is the story of how I built it, what broke, and what I would do differently.</p><h3>What Liyora does</h3><p>Liyora is a normal keyboard with one extra key, a red λ.</p><ol><li>Type in any app, such as WhatsApp, Messenger or Notes.</li><li>Tap the λ key.</li><li>A panel above the keys shows the English version.</li><li>Tap <strong>Apply</strong> to replace your text, or <strong>Dismiss</strong> to keep what you wrote.</li></ol><p>Your text is never replaced without your tap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*77UkM1P7j16Pik7zF4b_Jg.jpeg" /></figure><p>Behind the panel, Liyora sends your text to Google’s Gemini API and shows the answer. That is all it does.</p><h3>My first version failed</h3><p>My first version was not a keyboard. It was a floating bubble built with Android’s Accessibility Service. The bubble read the text field, translated it, and showed a popup. It worked on my phone, and I tagged it v1.0.0.</p><p>Then I looked at what it would take to publish it. Apps that use Accessibility Service are hard to distribute, and I did not want people to see scary warnings for a typing helper. So I dropped the bubble and rebuilt the app as a real keyboard, an Android input method. A keyboard is the normal, expected way for an app to help with typing.</p><p>The idea survived, but the way I delivered it did not. I am glad I changed the design before I had users.</p><h3>No server: bring your own key</h3><p>Liyora has no backend. Each user adds their own free Gemini API key from Google AI Studio, and the app talks to Google directly from the phone.</p><p>This has three effects:</p><ul><li>I pay nothing to run the app, however many people use it.</li><li>Every user gets their own free limit instead of sharing mine.</li><li>I never see anyone’s keys or text, because there is no server to see them.</li></ul><p>The cost is a setup step. Users must create a key, which is harder than installing an app from a store. I made that step shorter with a button inside the app that opens the key page.</p><h3>Several keys and automatic switching</h3><p>Free Gemini keys have a daily limit. I learned that the limit belongs to the Google project, not to the key. Two keys from the same Google account share one limit. Keys from different Google accounts do not.</p><p>So Liyora lets users save several keys. When one reaches its daily limit, the app switches to the next. If every key has reached its limit, it says so. Free limits reset at midnight Pacific time. Whether using several accounts is fine is a question for Google’s terms, so users should read them for themselves.</p><p>I also had to be careful about what counts as “limit reached.” In version 1.1.0, any quota error marked a key as used up for the day, even a short per-minute limit. Version 1.1.1 only treats it as the daily limit when every model says so.</p><h3>Security and privacy</h3><p>A keyboard sees what you type, so this part mattered most.</p><ul><li>Keys are stored encrypted on the phone.</li><li>Typed text is not saved or logged.</li><li>Password fields are detected and ignored.</li><li>No ads, no analytics, no accounts.</li></ul><p>Before making the repository public, I audited it. I searched the files and the whole Git history for keys, passwords and keystores, and found none. I did find my personal email address in the author field of my commits. I rewrote the history before the first push and switched to GitHub’s no-reply address. This check takes minutes. Do it before you click “public,” not after.</p><p>The app and the download page also carry one honest warning: text sent with a free Gemini key may be used by Google to improve its products. People should not translate private text with a free key.</p><h3>It worked on my phone, not on others</h3><p>After I shared the app, a friend created a key on his own phone and pasted it into Liyora. The app said “Something went wrong.” My key worked fine.</p><p>I traced it to four causes:</p><ol><li><strong>The model.</strong> Version 1.1.0 used one model, gemini-2.5-flash. Google’s documentation says some older models are only for users who have used them before. My Google project was old, so it still worked for me. New keys were refused.</li><li><strong>Hidden characters.</strong> A key copied from a web page can carry spaces, line breaks or invisible characters, and Android refuses to send such a request.</li><li><strong>One message for everything.</strong> A refused key, a busy server, a Wi-Fi login page and a missing connection all showed the same error.</li><li><strong>Keys blocked by mistake.</strong> Every quota error blocked a key for the day, and busy servers were never retried.</li></ol><p>Version 1.1.1 fixes these:</p><ul><li>It tries three current free-tier models in order, and remembers which one worked for each key.</li><li>Pasted keys are cleaned before they are saved.</li><li>Messages are specific: invalid key, daily limit reached, server busy, no internet, wrong date and time, blocked text.</li><li>A <strong>Check key</strong> button tests a key and shows the result in plain words.</li></ul><p>The big lesson: “it works on my phone” is not a test when your own account is older than your users’ accounts. Test with a brand-new account, on someone else’s phone, before you announce.</p><h3>Honest limits</h3><ul><li>Liyora is not on Google Play. You install it from my website, and Play Protect may show a warning.</li><li>It needs an internet connection.</li><li>Free keys have daily limits.</li><li>Text sent with a free key may be used by Google to improve its products.</li><li>I tested Sinhala and Singlish the most, and I also tried other languages. Quality depends on Gemini and on the text you type.</li><li>I have tested it on only a few phones, so I expect more surprises.</li></ul><h3>What is next</h3><p>Next I want to test Liyora on more phone brands and then try Google Play’s closed testing. A keyboard avoids the Accessibility Service problem that held the first version back.</p><p>Liyora is free and open source under the MIT license.</p><ul><li>Download: <a href="https://chavindujayawardana.com.lk/liyora">https://chavindujayawardana.com.lk/liyora</a></li><li>Code: <a href="https://github.com/chavindujayawardhana-pixel/liyora">https://github.com/chavindujayawardhana-pixel/liyora</a></li></ul><p>If you try it and something goes wrong, tap <strong>Check key</strong> first, then open an issue on GitHub. I want to hear about it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99f403e511a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Random Forest Decides if a File Looks Suspicious: The ML Layer of an Offline Antivirus]]></title>
            <link>https://medium.com/@chavindujayawardhana/how-a-random-forest-decides-if-a-file-looks-suspicious-the-ml-layer-of-an-offline-antivirus-bb0840f609ae?source=rss-d03893227365------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb0840f609ae</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[antivirus]]></category>
            <category><![CDATA[learning-in-public]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Chavindu Jayawardana]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 19:49:28 GMT</pubDate>
            <atom:updated>2026-10-16T19:49:50.046Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Suggested tags:</strong> Cybersecurity, Machine Learning, Python, Antivirus, Learning In Public</p><p>I am an IT student from Sri Lanka. I did not have a coding background when I started. I built DEVADARA, a small offline antivirus for Windows, with Claude Code as my pair programmer.</p><p>This post is about one part of it: the machine learning layer. How does a program decide that a file “looks dangerous” without ever running it? And where does that idea break?</p><p>I will also be honest about what went wrong. That is the most useful part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtZ276__MD0R7db86NaCGQ.png" /></figure><h3>Why hashes are not enough</h3><p>The first layer of DEVADARA is simple. It computes a SHA256 hash of a file and checks if that hash is on a list of known bad files. This is like recognising a face you have seen before.</p><p>But a brand new threat has no hash on any list yet. You need a second skill: noticing that something <em>looks like</em> the dangerous things you have seen. In my immune system analogy, hashes are memory cells. The ML model is pattern recognition.</p><h3>Turning a file into numbers</h3><p>A Windows program (.exe, .dll) is a PE file. At the start of every PE file there is a header with facts about the file: how big the sections are, what the entry point is, what version of Windows it targets, and more.</p><p>I use a Python library called pefile to read <strong>52 fields</strong> from this header. The file is never run. That is important for safety. The result is a list of 52 numbers.</p><h3>The Random Forest</h3><p>A Random Forest is a group of decision trees. Each tree asks a chain of simple questions about the numbers. For example: “Is this section unusually large? Is this value zero?” At the end, the tree votes.</p><p>My model has <strong>200 trees</strong>. Think of 200 judges who each look at the file in a slightly different way. If most of them vote “suspicious”, the probability goes up. The result is not yes or no. It is a probability.</p><p>The model is trained once, offline, on a dataset of about 19,600 PE files. It ships inside the app. It never updates itself and it never uploads anything.</p><h3>From probability to a decision</h3><p>I do not use a single yes/no line. I use tiers:</p><ul><li><strong>85% or more:</strong> malware</li><li><strong>60% to 85%:</strong> suspicious (a human should look)</li><li><strong>Below 60%:</strong> safe</li></ul><p>Why? Because a wrong “malware” label on a normal file teaches people to ignore the tool. A middle tier says “I am not sure, please check” and that is an honest answer.</p><h3>The part that went wrong: false positives</h3><p>When I scanned my own developer PC, the model flagged many files from tools like Flutter, the Android SDK and Git as High Risk. They were safe.</p><p>The reason is simple once you see it. The model only looks at 52 header numbers. Compilers, installers and developer tools make unusual headers, and unusual looks a lot like malware to a model that only sees headers.</p><p>Here is what I did about it. I did <strong>not</strong> retrain the model for v1.0. Instead I built guard rails around it:</p><ol><li><strong>Signature first.</strong> If a file has a valid, trusted Windows digital signature, the ML model is skipped.</li><li><strong>YARA “suspicious” is a floor.</strong> A rule match can raise a verdict but a later layer can never lower it below “suspicious”.</li><li><strong>A name match is not trust.</strong> A file that only <em>claims</em> a known publisher can only lower “malware” to “suspicious”.</li><li><strong>Nothing acts on its own.</strong> Every quarantine or delete needs a click. Cancel is the default.</li></ol><p>The order of the checks mattered more than any single detector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-k4dtARoBSlcSE2y4TYXgA.png" /></figure><h3>Smaller bugs that taught me more</h3><ul><li><strong>“Loading detection engine…” forever.</strong> My exe worked on my PC but froze after packaging. The cause: the ML model is a pickled scikit-learn object, and PyInstaller could not see that scikit-learn was needed. I had to list it as a hidden import. Lesson: anything loaded by name at run time must be listed by hand.</li><li><strong>A “frozen” scan that was not frozen.</strong> A scan seemed stuck for 44 seconds. It was actually running PowerShell 109 times in a row without showing progress. I grouped the checks in batches, and the maximum wait dropped to about 3 seconds. Lesson: measure before you guess.</li></ul><h3>Honest limits</h3><p>I want to be clear about what this model is not:</p><ul><li>It only reads <strong>header fields</strong>. It does not watch what a program does.</li><li>It is trained once and does not learn from new files on its own.</li><li>It is <strong>not</strong> a replacement for Microsoft Defender.</li><li>I have tested it only on my own PC.</li><li>I have not yet documented the original source of the training dataset.</li></ul><h3>A security review of my own project</h3><p>After I published DEVADARA, an external reviewer raised four points about it: the order of steps when a file is quarantined, how the ML model file is loaded, how much real malware the layers can catch, and checks that can fail quietly.</p><h3>What I learned</h3><ol><li><strong>Order matters as much as the checks.</strong> Putting the signature check before the ML model changed results more than any detector.</li><li><strong>False positives are the hardest part of security software.</strong> Catching a test file is easy. Not flagging a developer’s own tools is hard.</li><li><strong>Write your rules down.</strong> One file with the project rules (never auto-act, Cancel is default) kept the design consistent while I was learning.</li><li><strong>Say what you do not know.</strong> A README with honest limits is worth more than a long feature list.</li></ol><p>DEVADARA is open source under the MIT license.</p><ul><li>Code and README: <a href="https://github.com/chavindujayawardhana-pixel/devadara-releases">https://github.com/chavindujayawardhana-pixel/devadara-releases</a></li><li>Project page: <a href="https://www.chavindujayawardana.com.lk/devadara">https://www.chavindujayawardana.com.lk/devadara</a></li></ul><p>If you have feedback on the model, the guard rails, or the limits I listed, I would like to hear it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb0840f609ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m Building an Antivirus That Works Like Your Immune System, and It Never Leaves Your Computer]]></title>
            <link>https://medium.com/@chavindujayawardhana/im-building-an-antivirus-that-works-like-your-immune-system-and-it-never-leaves-your-computer-e0f7eccde3a8?source=rss-d03893227365------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0f7eccde3a8</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[antivirus]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Chavindu Jayawardana]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 07:29:49 GMT</pubDate>
            <atom:updated>2026-10-13T05:23:05.035Z</atom:updated>
            <content:encoded><![CDATA[<p>I have no formal coding background. I’m an IT student from Sri Lanka, and I wanted to learn how antivirus software really works. So I decided to build one, and I called it DEVADARA.</p><h3>The idea: copy the human body</h3><p>Your body has three lines of defence. I’m copying all three.</p><p><strong>1. Memory cells (known threats).</strong> After you catch a cold once, your body remembers it. DEVADARA does the same with files. It makes a SHA-256 fingerprint (a unique ID built from a file’s contents) and checks it against a local database of known threats. If the fingerprint matches, the file is recognised at once.</p><p><strong>2. Pattern recognition (unknown threats).</strong> Your body can also react to a germ it has never met, because it looks similar to one it knows. DEVADARA uses a machine learning model (scikit-learn), trained locally, to spot files that look suspicious even when no exact match exists. It also uses YARA rules (text patterns that describe how malware tends to look) and checks a file’s digital signature.</p><p><strong>3. Adaptive memory (partly built).</strong> <strong>When you confirm a file as a threat and quarantine it, DEVADARA remembers its fingerprint on your own computer and recognises the same file instantly in later scans. If you restore the file, it forgets it again. Nothing leaves your computer. What is not built yet: the machine learning model does not retrain itself from your decisions. That is planned for a later version.</strong></p><h3>Privacy is the whole point</h3><p>DEVADARA runs 100% offline. There is no cloud lookup, no account, and no file is uploaded anywhere. Many security tools send your data to a server to check it. I wanted one where your files stay yours.</p><h3>It watches your Downloads folder</h3><p>Most malware arrives through downloads, so while DEVADARA is open, it scans each new file in your Downloads folder once it has finished downloading. It also scans USB drives when you plug them in.</p><p>It also watches that folder for ransomware-style behaviour. If a large number of files suddenly change within a few seconds, it shows an alert and lists the programs that might be responsible. You can then suspend or stop a program, but only if you choose to. It never acts on its own.</p><p>I want to be honest about the limits. It only watches the Downloads folder, only while the app is running, and it detects by speed of file activity, so false alarms are possible. <strong>It also does not look inside zip files yet.</strong> It’s an alert-and-review tool, not an automatic blocker.</p><h3>It’s careful, because false alarms hurt too</h3><p>An antivirus that cries wolf is almost as bad as one that misses threats. So DEVADARA does not trust any single signal. It combines several pieces of evidence, and a valid signature alone never makes a file “safe”. Results use four plain labels: Known Good, High Risk, Suspicious, and Not flagged. If you disagree with a result, you can ignore a file. DEVADARA remembers both its location and its fingerprint, so if the file changes later, it gets checked again.</p><h3>It never deletes anything on its own</h3><p>This is a rule I will not break. DEVADARA moves risky files to quarantine (an isolated holding area) instead of deleting them. Permanent deletion only happens when you confirm it yourself, and in Settings you can switch deletion off completely.</p><h3>Can you trust the antivirus itself?</h3><p>If malware could quietly edit your antivirus, the protection would be worthless. <strong>So every file in the download is listed in a digitally signed manifest (Ed25519 signatures), and DEVADARA checks its own files against it. If even one file is changed, it shows “PROBLEMS FOUND” and how many files changed. I tested this myself: I edited a single file in a copy of the app, and it was caught. You can see the result under Settings → About.</strong></p><h3>Download</h3><p><strong>DEVADARA 1.0 is a 115 MB zip file. Extract it, then run </strong><strong>DEVADARA.exe inside the folder.</strong></p><p><strong>Because this is new software from an independent developer, it is not signed with a paid Microsoft-recognised certificate yet. Windows SmartScreen may show “Unknown publisher”. That is expected. Download it only from my website, and choose “More info → Run anyway” if you trust it.</strong></p><h3>What’s next</h3><p>I’m building this in phases. <strong>Version 1 combines hash matching, the ML model, a Downloads and USB watcher, and manual deletion.</strong> Later versions will retrain from your decisions, watch more folders, add an installer, and offer an optional, opt-in way to share threat information.</p><p>This is a learning project and a portfolio piece, so I’ll be honest: it’s not a replacement for a mature commercial antivirus yet. But building it has taught me more about security than any course.</p><p>You can follow the project here: <a href="https://www.chavindujayawardana.com.lk/devadara">DEVADARA — Natural Defense. Digital World.</a></p><p>I’d love your feedback, especially from security people who can point out what I’ve missed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0f7eccde3a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>