<?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 3m Mohamed on Medium]]></title>
        <description><![CDATA[Stories by 3m Mohamed on Medium]]></description>
        <link>https://medium.com/@3m_Mohamed?source=rss-a0ea0da65ced------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*FHFSDvahbi-JcRUd</url>
            <title>Stories by 3m Mohamed on Medium</title>
            <link>https://medium.com/@3m_Mohamed?source=rss-a0ea0da65ced------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 15:58:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@3m_Mohamed/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[Breaking ROT13 — picoCTF Easy Challenge Writeup]]></title>
            <link>https://medium.com/@3m_Mohamed/breaking-rot13-picoctf-easy-challenge-writeup-1e0e15f141df?source=rss-a0ea0da65ced------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e0e15f141df</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[rot13]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacker]]></category>
            <dc:creator><![CDATA[3m Mohamed]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 14:39:56 GMT</pubDate>
            <atom:updated>2026-02-22T14:39:56.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ekCLOSosjbe-ukZn" /></figure><p>This challenge on <strong>picoCTF</strong> is classified as _Easy_ and relies on a very simple classical cipher called <strong>ROT13</strong> (Rotation 13).</p><h4>What is ROT13?</h4><p>ROT13 stands for <strong>Rotation 13</strong>, which means shifting each letter 13 positions forward in the alphabet.</p><p>Since the English alphabet has 26 letters, and 13 is exactly half of 26, applying ROT13 twice returns the original text.</p><h4>Example</h4><p>Take the word:</p><pre>HELLO</pre><blockquote>Apply ROT13 to each letter:</blockquote><blockquote>- H → U<br>- E → R<br>- L → Y<br>- L → Y<br>- O → B</blockquote><p>So:</p><pre>HELLO → URYYB</pre><p>Now here’s the interesting part:</p><p>If we apply ROT13 again to <strong>URYYB</strong>, we get back:</p><pre>URYYB → HELLO</pre><p>That’s because ROT13 is symmetric — encrypting twice restores the original message.</p><h4>The Challenge</h4><p>The flag was provided already encoded with ROT13:</p><pre>cvpbPGS{arkg_gvzr_V&#39;yy_gel_2_ebhaqf_bs_ebg13_45559noq}</pre><p>Our task was simply to decode it back to its original form.</p><h4>Solution Using Python</h4><p>We can easily decode ROT13 in Python using the built-in <strong>codecs</strong> library:</p><pre>import codecs<br>print(codecs.decode(&quot;cvpbPGS{arkg_gvzr_V&#39;yy_gel_2_ebhaqf_bs_ebg13_45559noq}&quot;, &quot;rot_13&quot;))</pre><h4>Output:</h4><pre>picoCTF{next_time_I&#39;ll_try_2_rounds_of_rot13_45559abd}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e0e15f141df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CryptoHack Challenge: Find (p, q)]]></title>
            <link>https://medium.com/@3m_Mohamed/cryptohack-challenge-find-p-q-d5e1025f1d86?source=rss-a0ea0da65ced------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5e1025f1d86</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[methodology]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[rsa]]></category>
            <dc:creator><![CDATA[3m Mohamed]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 07:12:45 GMT</pubDate>
            <atom:updated>2026-02-22T07:12:45.489Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DrKO0GRfSBIG5noW" /></figure><p>This challenge from CryptoHack asks us to find the values of p and q given:</p><blockquote>N=p⋅q</blockquote><blockquote>c1=(2p+3q)e1mod N</blockquote><blockquote>c2=(5p+7q)e2mod N</blockquote><p>At first glance, it might seem like we need to use the ciphertexts c1,c2​ and the exponents e1,e2 to solve the challenge. But the solution is actually much simpler. The key idea is that once we know the values of p and q, the challenge is essentially solved, regardless of the additional data.</p><h4>Step 1: Factorize N</h4><p>The first step is to factorize the modulus N. Using (factordb.com) , we can quickly get the prime factors p and q. They are:</p><pre>p = 112274000169258486390262064441991200608556376127408952701514962644340921899196091557519382763356534106376906489445103255177593594898966250176773605432765983897105047795619470659157057093771407309168345670541418772427807148039207489900810013783673957984006269120652134007689272484517805398390277308001719431273<br>q = 132760587806365301971479157072031448380135765794466787456948786731168095877956875295282661565488242190731593282663694728914945967253173047324353981530949360031535707374701705328450856944598803228299967009004598984671293494375599408764139743217465012770376728876547958852025425539298410751132782632817947101601</pre><h3>Step 2: The flag</h3><p>With these values of p and q, the challenge is solved. The flag is:</p><pre>crypto{112274000169258486390262064441991200608556376127408952701514962644340921899196091557519382763356534106376906489445103255177593594898966250176773605432765983897105047795619470659157057093771407309168345670541418772427807148039207489900810013783673957984006269120652134007689272484517805398390277308001719431273, 132760587806365301971479157072031448380135765794466787456948786731168095877956875295282661565488242190731593282663694728914945967253173047324353981530949360031535707374701705328450856944598803228299967009004598984671293494375599408764139743217465012770376728876547958852025425539298410751132782632817947101601}</pre><h3>Original Challenge Data</h3><p>For reference, here are the original parameters provided in the challenge:</p><pre>N = 14905562257842714057932724129575002825405393502650869767115942606408600343380327866258982402447992564988466588305174271674657844352454543958847568190372446723549627752274442789184236490768272313187410077124234699854724907039770193680822495470532218905083459730998003622926152590597710213127952141056029516116785229504645179830037937222022291571738973603920664929150436463632305664687903244972880062028301085749434688159905768052041207513149370212313943117665914802379158613359049957688563885391972151218676545972118494969247440489763431359679770422939441710783575668679693678435669541781490217731619224470152467768073<br>c1 = 14010729418703228234352465883041270611113735889838753433295478495763409056136734155612156934673988344882629541204985909650433819205298939877837314145082403528055884752079219150739849992921393509593620449489882380176216648401057401569934043087087362272303101549800941212057354903559653373299153430753882035233354304783275982332995766778499425529570008008029401325668301144188970480975565215953953985078281395545902102245755862663621187438677596628109967066418993851632543137353041712721919291521767262678140115188735994447949166616101182806820741928292882642234238450207472914232596747755261325098225968268926580993051<br>c2 = 14386997138637978860748278986945098648507142864584111124202580365103793165811666987664851210230009375267398957979494066880296418013345006977654742303441030008490816239306394492168516278328851513359596253775965916326353050138738183351643338294802012193721879700283088378587949921991198231956871429805847767716137817313612304833733918657887480468724409753522369325138502059408241232155633806496752350562284794715321835226991147547651155287812485862794935695241612676255374480132722940682140395725089329445356434489384831036205387293760789976615210310436732813848937666608611803196199865435145094486231635966885932646519<br>e1 = 12886657667389660800780796462970504910193928992888518978200029826975978624718627799215564700096007849924866627154987365059524315097631111242449314835868137<br>e2 = 12110586673991788415780355139635579057920926864887110308343229256046868242179445444897790171351302575188607117081580121488253540215781625598048021161675697</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5e1025f1d86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking RSA When One Prime Is Known]]></title>
            <link>https://medium.com/@3m_Mohamed/breaking-rsa-when-one-prime-is-known-0cc9cd8ecbeb?source=rss-a0ea0da65ced------2</link>
            <guid isPermaLink="false">https://medium.com/p/0cc9cd8ecbeb</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[rsa]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[decryption]]></category>
            <dc:creator><![CDATA[3m Mohamed]]></dc:creator>
            <pubDate>Sat, 21 Feb 2026 02:56:29 GMT</pubDate>
            <atom:updated>2026-02-21T02:56:29.961Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Illustration related to RSA cryptography and mathematical encryption concepts" src="https://cdn-images-1.medium.com/max/1024/0*2njoOyAX3rexJR05" /></figure><h4>Given Parameters</h4><blockquote>We are given the following RSA parameters:</blockquote><blockquote>- n (modulus)<br>- e = 65537` (public exponent)<br>- q (one of the prime factors of n)<br>- ct (ciphertext)<br> <br>Our goal is to recover the private key and decrypt the ciphertext.</blockquote><h4><strong>Step 1: Recover Prime `p`</strong></h4><p>Since RSA modulus is:<br>n = p × q</p><p>And we are already given `q`, we can simply compute:<br>p = n // q</p><h4>Python Code</h4><pre>n = 27176393407935103481163155837427742913736162805163960331439171299917803847839120808804732675657161001205777890520029973936343262372935454665420601809184894777707812681056603978295816651555470815138953238837510805670059628515533201723738377384999931828902088379359668739224568459312311491647662096047608516941790769030123418245983210222253698355788103344141929121912734282726220821892263490249842323331218356969957620712358194016204473618770451542777841273366511873769514760320835637280801421908082271238575146984814792169032375163458775970856228129500375398873773737464366440067238916256182804432304462869247002029101<br>q = 168008506905664925715285139876758539830754830224705503363675220828724350021417486524153965414795915910336943871042520716787575587167438973647616275446906752249150745789966942951708080250022889744527067101811169627378390925138067431522589236137308344943601351833634383376801541020263961063873667195177625444329<br><br>p = n // q<br>print(p)</pre><p>Now we have successfully recovered the second prime `p`.</p><h4><strong>Step 2: Compute Euler’s Totient φ(n)</strong></h4><p>In RSA:<br>φ(n) = (p — 1)(q — 1)</p><p>Since both primes are large, we compute it programmatically:</p><pre>p = 161756055740643972364204644484720291006211449178135264616734170684907466873538686754510913792249746727418936063266353226525417186385465297082848950524339225132875643194414485391134706086831776353064093213418869366847156172809507125402650084352525639525234715553410189146803074613797575520888718460009752437669<br>q = 161756055740643972364204644484720291006211449178135264616734170684907466873538686754510913792249746727418936063266353226525417186385465297082848950524339225132875643194414485391134706086831776353064093213418869366847156172809507125402650084352525639525234715553410189146803074613797575520888718460009752437669<br><br>phi = (p - 1) * (q - 1)<br>print(phi)</pre><h4>Step 3: Compute the Private Key `d`</h4><p>The private exponent `d` is the modular inverse of `e` modulo `φ(n)`:<br>d ≡ e⁻¹ mod φ(n)</p><p>Using Python:</p><pre>phi = 26165021568770319806879026808480457259900771373690452389849534531832672624925642013460365959579125784580256320935777125335748797829516171079760856478196623319510931952308062656422218951976521010140132216063582780941532708497323400926530659158948762157203201389219617500938726907321367336209237971718679832125147323354407331702142382435149576207352641225512036534664440781851185743389321244672188344187128690979491439586862553517771076417170860536479578762191195210256237736248495655688083710070078020998648518293772434743786412107155184671222220560177616360480445007162396709809646957218751317491197012600468225278224<br>e = 65537<br><br>d = pow(e, -1, phi)<br>print(d)</pre><p><strong>Now we have the private key `d`.</strong></p><h4>Step 4: Decrypt the Ciphertext</h4><p>RSA decryption formula:<br>m = ct^d mod n</p><p>Then convert the integer message to bytes:</p><pre>from Crypto.Util.number import long_to_bytes<br><br>n = 27176393407935103481163155837427742913736162805163960331439171299917803847839120808804732675657161001205777890520029973936343262372935454665420601809184894777707812681056603978295816651555470815138953238837510805670059628515533201723738377384999931828902088379359668739224568459312311491647662096047608516941790769030123418245983210222253698355788103344141929121912734282726220821892263490249842323331218356969957620712358194016204473618770451542777841273366511873769514760320835637280801421908082271238575146984814792169032375163458775970856228129500375398873773737464366440067238916256182804432304462869247002029101<br>ct = 7542069583043416807452553211097827563470682071572429815679869990681195991689118606379814159564977708578317869931634576286998617751467377481689531028872559287315494504937856065012239953916794992144403922067468433860167270142361449581924727575288593745784169996502257109659927206432888579117792656968701076957165772580318947902569670302444363484622324132788629212183317805804668382990889253975525432562896059378168492513786491326868679194138009976194283715088628524705176665804404751533851985305547948231110262797494804504609270604282807272038498673992761913057381230614846843958234511763979488427254180506475264982385<br>d = 8831198820531905246321376825359533005615225945435903487548586353420796168017382567675409234873281693622156488992468224246254229030759688485654060230064075374636950345378249629370576669937907513989040154711482843499499572942929850748353726606282658939489674759746981691575211547521989799303421638683754182928853301075720435437255130681378589586136692614985828587618863086417569138712052518915251021154756651120227514894813611911028826622332719457206284728011188154033110742417515661440413990062867171589943165305983585707807123240463748492110342536141856873122471940406674324747690475512745153774284418248048539651713<br><br>pt = pow(ct, d, n)<br>print(long_to_bytes(pt))</pre><p>Final Result<br><strong>b’crypto{700_m4ny_5m4ll_f4c70r5}’</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0cc9cd8ecbeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[picoCTF — Mini RSA (Low Exponent Attack, Hard)]]></title>
            <link>https://medium.com/@3m_Mohamed/picoctf-mini-rsa-low-exponent-attack-hard-9a5ddbe1df43?source=rss-a0ea0da65ced------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a5ddbe1df43</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[rsa]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[3m Mohamed]]></dc:creator>
            <pubDate>Sat, 21 Feb 2026 00:24:44 GMT</pubDate>
            <atom:updated>2026-02-21T00:24:44.087Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="RSA Cryptography Concept for Mini RSA Challenge" src="https://cdn-images-1.medium.com/max/1024/0*aWAwo9DRJ7YZW6Nz" /></figure><h4>Challenge Overview</h4><p>This challenge provides:</p><p>N = 29331922499794985782735976045591164936683059380558950386560160105740343201513369939006307531165922708949619162698623675349030430859547825708994708321803705309459438099340427770580064400911431856656901982789948285309956111848686906152664473350940486507451771223435835260168971210087470894448460745593956840586530527915802541450092946574694809584880896601317519794442862977471129319781313161842056501715040555964011899589002863730868679527184420789010551475067862907739054966183120621407246398518098981106431219207697870293412176440482900183550467375190239898455201170831410460483829448603477361305838743852756938687673<br>e = 3 <br>ct = 2205316413931134031074603746928247799030155221252519872649622995851062066797104976576648278887641167039543933368816966980088199618263707965144410196221515382091075908641188723134211300219842068606116987558791015172631248409305928941376357</p><p>The goal is to recover the plaintext.</p><h4>Observations:</h4><blockquote>In standard RSA:</blockquote><blockquote>c ≡ m^e mod N</blockquote><blockquote>Here, since:</blockquote><blockquote>e = 3</blockquote><blockquote>we need to check whether the modular reduction affected the ciphertext.</blockquote><blockquote>If:</blockquote><blockquote>m^e &lt; N</blockquote><blockquote>then the modular reduction has no effect, meaning:</blockquote><blockquote>c ≡ m^e</blockquote><blockquote>In this case:</blockquote><blockquote>c ≡ m³</blockquote><blockquote>This makes the system vulnerable to a **Low Public Exponent Attack**.</blockquote><h4>Attack Strategy:</h4><p>Since:</p><p>c ≡ m³</p><p>we can directly recover the plaintext by computing the integer cube root of the ciphertext:</p><p>m ≡ √c³</p><p>If the cube root is exact (without remainder), the plaintext is successfully recovered.</p><h4>Exploit Code</h4><pre>from Crypto.Util.number import long_to_bytes<br>import gmpy2<br><br>ct = 2205316413931134031074603746928247799030155221252519872649622995851062066797104976576648278887641167039543933368816966980088199618263707965144410196221515382091075908641188723134211300219842068606116987558791015172631248409305928941376357<br>e = 3<br>pt, exact = gmpy2.iroot(ct, e)<br><br>if exact:<br>   print(long_to_bytes(pt))</pre><h4>Result</h4><p>Recovered plaintext:<br><strong>picoCTF{n33d_a_lArg3r_e_3dec5522}</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a5ddbe1df43" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>