Posts

Showing posts from March, 2023

A Web Interface to Try Dual Key Caesar Cipher Encryption and Decryption

https://frontendkaizen.blogspot.com/2022/03/dual-key-caesar-cipher.html Give it a try. If it looks less pretty than it could, it's because I don't know how to hack Blogger well enough 😊 If you Google "decode caesar cipher", you get to : https://www.dcode.fr/caesar-cipher https://www.boxentriq.com/code-breaking/caesar-cipher https://www.thewordfinder.com/caesar-cipher-solver/ All of which are okay for a single key - for encoding. One of them probably does true solving in the sense of finding the best candidate after brute force searching. But none does true code-breaking by looking at character frequency (unless they do😊). But what about two keys?!! There wasn't anything online (for decrypting that is. The dcode site does do encryption, but is really hard to use) Until now :) Give it a try :  https://frontendkaizen.blogspot.com/2022/03/dual-key-caesar-cipher.html Kudos to Tamer Abd Alrazaq for porting the java to javascript and getting it to work in the blink of ...

An All Time Classic (Duke Coursera Javascript Paint Tool)

Image
This one is not as easy as the To Do list exercise. But, boy am I proud. If you want to do even the teeniest bit of web hacking, I'd recommend doing this one every few weeks to maintain your cognitive savvy! I added a feature - adding text to the canvas - all the controls you see to the right of the canvas are my invention :) That was fun :)  https://codepen.io/chipdesigner/pen/oNPEWVZ FYI, the text controls you see on the right of the canvas, I wasn't able to put the other controls - Brush color and size below the canvas without this tip :  html - arranging div one below the other - Stack Overflow . Go figure..

Practising What I Preach (TO DO List Exercise)

I'd said one should do the Duke University To-Do-List exercise every so often to maintain confidence. I stand by it. It takes about 45 minutes the very first time - following the tutorial. Took me almost 90 minutes today starting from a blank codepen. Try it again with no recourse to a walk-through doc, and you learn so much more - so many new questions come up. In the old implementation, now I realize I have a bug - a task could be "done" or "important", but not both. So, if I had a task that was "done", and now I clicked the "important" button, it's class would change and I would no longer be able to delete it :) Another feature added : return focus to the text field for task-name after adding the task - that's a cool one - probably more useful for testing than anything :) item.classList.contains(name), .add(name), .remove(name) - your best friends. When you call a function, use onclick="funcName(this)" or "funcName...

The Low Down - Why the Useful Portion of the Page Isn't Maximized

Image
https://www.dukelearntoprogram.com/course2/doc/javadoc/index.html?course=2 Go there and, if you have OCD like me, you ask this question : And the response  (takeaways : CTRL-SHIFT-C to point and select an element. And you get the element.style {} standing by to let you tweak it! Also, height:75vh; in CSS gives you 75% of the viewport. Thank you Upwork. How to open Chrome dev. Tool :-  CTRL-SHIFT-C How to tweak CSS and change CSS of the page ? ● In the dev tool in the Elements window there is a tab (or section ) named Styles. ● You can add new css rules and remove the old rules i this section ( NOTE: these changes are temporary and will be removed after the page is reloaded ) How to target the section whose style you want to change? ● There is a small arrow key in the top left of the dev. tool.   ● Select that tool or just press CTRL-SHIFT-C again. ● Now hover over to the section you want to modify and click on it.  ● Make sure to select the outermost...

Steganography 101

Image
Alright, the description of what they were doing was pretty basic, so I wondered if I should do the exercise - itching to get to Course 2 you see 😊 And, it paid off big time. I would have been happy to do just the hidden image recovery - but, ended up whacking out the encoder and decoder in a decent time. Okay, what is it in a nutshell? Each R,G,B pixel has eight bits. Retain the four MSBs (Most Significant Bits) and use the four LSBs (Least SBs) to store the MSBs of your message. Neat, eh? Of course, you can only store an image of same or smaller size, so the first thing you do is a crop.. So, starting with : hilton.jpg 140x210 As the "cloak" image, you want to hide this one, the "data" : usain.jpg(300x300) Cropping :  function crop( img_cloak, img_data ){ var cropped_data = new SimpleImage(width=Math.min(img_cloak.getWidth(),img_data.getWidth() ), height=Math.min(img_cloak.getHeight(), img_data.getHeight() ) ); var p; for( p of cropped_data.values(...