Reddit Programming
208 subscribers
1.22K photos
124K links
I will send you newest post from subreddit /r/programming
Download Telegram
Help needed: multilayer cipher (Caesar → Atbash → Keyword("keyword") → Rail Fence(k=2)) — brute force failed
https://www.reddit.com/r/programming/comments/1ojr7c2/help_needed_multilayer_cipher_caesar_atbash/

<!-- SC_OFF -->Hi everyone — I’ve been stuck on this multilayer cipher and could use a fresh pair of eyes. Ciphertext (final encrypted output): fm f zfprz md yrqvdjny ypz v wnnu dq uvx wvw yfz vdpuanf djpohy fv mavqlznu m qaf bdnvdu wnwafjh dvnm w udw dqd udcfdnf fnu ypz w udovydfaud y fonqcbx f rddhnmwpud zm d y yndrdqqvwafjh dnfsynarddb ywvwxdrudnf ukhfpn fdjd drvzhmaqnu wnw f f njpnfpad ddfyvcnfofmzfbtfb rjf f zfpcd qdndxq dzfvan xqb wntq rwxdrndxq dmv v tvwpzmwd dfd py lq qn tkvfuapnwxfznz qd What I was told about the encryption chain (in order of application, plaintext → ciphertext): Caesar (unknown shift) Atbash Keyword cipher using keyword: "keyword" Rail Fence with key = 2, offset = 0 So to decrypt you would reverse those steps: RailFence⁻¹ → Keyword⁻¹ → Atbash⁻¹ → Caesar⁻¹. What I’ve already tried (exhaustively / algorithmically): Rail Fence decrypt with key=2 applied both to: the full text including spaces/punctuation, and letters-only (i.e., remove non-letters before rail-fence and keep letters-only through subsequent steps). Rail starting offsets: tried start rail = 0 and start rail = 1. Keyword cipher variants using keyword: keyed alphabets tried: keyword + remaining, remaining + keyword, keyword + reversed(remaining), reversed(keyed), and a variant that merges i/j (classic Playfair-style handling). both mapping conventions (i.e., whether keyed alphabet was used as the ciphertext alphabet or as the plaintext alphabet). Atbash (standard az) as implemented normally. Caesar shifts all 0–25 (brute force). Two orders for the last steps (Atbash→Caesar and Caesar→Atbash) — just in case the description differed slightly. Scored outputs by English heuristics (common-word matches + frequency) and inspected the top candidates. What I found:
None of the automated attempts produced a clean, obviously-correct English plaintext. A few high-scoring candidates contained fragments that look like corrupted English (words or partial words), which suggests we’re close but some parameter (keyword alphabet construction, punctuation handling at Rail-Fence, or Caesar specifics) is still different than assumed. Here’s what I’m asking for (helpful test ideas): If you want to try it, please post your decryption attempt and include: which Rail-Fence interpretation you used (letters-only vs fulltext, start rail 0/1), which keyword alphabet construction (exact keyed alphabet string), and whether you assumed the keyword mapped plaintext→cipher or cipher→plaintext, whether you merged i/j or otherwise modified the alphabet, whether you applied Atbash before or after Caesar, and the Caesar shift you tried. If you have a favorite solver or hill-climbing/substitution solver (e.g., simulated annealing for monoalphabetic substitution), please try it on the state after reversing the Rail Fence and Keyword steps (or on earlier/later intermediate states) — I’ve exhausted the simple brute-force space and an intelligent substitution solver might find the monoalphabetic mapping. If this looks like it could be non-English or contains a substitution variant I didn’t try (like keyed Vigenère instead of a simple keyword monoalphabetic), please say so — I’m open to that possibility. Extra context: I can provide intermediate states (the Rail-Fence-decoded result for letters-only / full-text, etc.) if that helps — say which variant you want and I’ll paste it. Thanks in advance — any idea, clue, or direction is appreciated! <!-- SC_ON --> submitted by /u/Front-Cabinet4945 (https://www.reddit.com/user/Front-Cabinet4945)
[link] (https://www.reddit.com/r/programming/submit/?type=LINK) [comments] (https://www.reddit.com/r/programming/comments/1ojr7c2/help_needed_multilayer_cipher_caesar_atbash/)
Dithering - Part 1
https://www.reddit.com/r/programming/comments/1ojtfvn/dithering_part_1/

<!-- SC_OFF -->Disclaimer - I am NOT the OP of this post. Saw this over on HN and wanted to share here. <!-- SC_ON --> submitted by /u/brokePlusPlusCoder (https://www.reddit.com/user/brokePlusPlusCoder)
[link] (https://visualrambling.space/dithering-part-1/) [comments] (https://www.reddit.com/r/programming/comments/1ojtfvn/dithering_part_1/)
Fil-C: A memory-safe C implementation
https://www.reddit.com/r/programming/comments/1ojwnec/filc_a_memorysafe_c_implementation/

<!-- SC_OFF -->A memory-safe implementation of C and C++ that aims to let C code run safely, unmodified. <!-- SC_ON --> submitted by /u/waozen (https://www.reddit.com/user/waozen)
[link] (https://lwn.net/SubscriberLink/1042938/38d8dde9db211cab/) [comments] (https://www.reddit.com/r/programming/comments/1ojwnec/filc_a_memorysafe_c_implementation/)
How to Build a DenseNet201 Model for Sports Image Classification
https://www.reddit.com/r/programming/comments/1ok66er/how_to_build_a_densenet201_model_for_sports_image/

<!-- SC_OFF -->Hi, For anyone studying image classification with DenseNet201, this tutorial walks through preparing a sports dataset, standardizing images, and encoding labels. It explains why DenseNet201 is a strong transfer-learning backbone for limited data and demonstrates training, evaluation, and single-image prediction with clear preprocessing steps. Written explanation with code: https://eranfeit.net/how-to-build-a-densenet201-model-for-sports-image-classification/
Video explanation: https://youtu.be/TJ3i5r1pq98 This content is educational only, and I welcome constructive feedback or comparisons from your own experiments. Eran <!-- SC_ON --> submitted by /u/Feitgemel (https://www.reddit.com/user/Feitgemel)
[link] (https://eranfeit.net/how-to-build-a-densenet201-model-for-sports-image-classification/) [comments] (https://www.reddit.com/r/programming/comments/1ok66er/how_to_build_a_densenet201_model_for_sports_image/)
Tik Tok saved $300000 per year in computing costs by having an intern partially rewrite a microservice in Rust.
https://www.reddit.com/r/programming/comments/1okf0md/tik_tok_saved_300000_per_year_in_computing_costs/

<!-- SC_OFF -->Nowadays, many developers claim that optimization is pointless because computers are fast, and developer time is expensive. While that may be true, optimization is not always pointless. Running server farms can be expensive, as well. Go is not a super slow language. However, after profiling, an intern at TikTok rewrote part of a single CPU-bound micro-service from Go into Rust, and it offered a drop from 78.3% CPU usage to 52% CPU usage. It dropped memory usage from 7.4% to 2.07%, and it dropped p99 latency from 19.87ms to 4.79ms. In addition, the rewrite enabled the micro-service to handle twice the traffic. The saved money comes from the reduced costs from needing fewer vCPU cores running. While this may seem like an insignificant savings for a company of TikTok's scale, it was only a partial rewrite of a single micro-service, and the work was done by an intern. <!-- SC_ON --> submitted by /u/InfinitesimaInfinity (https://www.reddit.com/user/InfinitesimaInfinity)
[link] (https://www.linkedin.com/posts/animesh-gaitonde_tech-systemdesign-rust-activity-7377602168482160640-z_gL) [comments] (https://www.reddit.com/r/programming/comments/1okf0md/tik_tok_saved_300000_per_year_in_computing_costs/)
An interview with Ken Silverman, creator of the Build Engine (Duke Nukem 3d, Shadow Warrior, Blood). Ken programmed the engine at the age of just 17.
https://www.reddit.com/r/programming/comments/1okfimd/an_interview_with_ken_silverman_creator_of_the/

submitted by /u/Tech-Jesse (https://www.reddit.com/user/Tech-Jesse)
[link] (https://youtu.be/WruzfQLxpQY) [comments] (https://www.reddit.com/r/programming/comments/1okfimd/an_interview_with_ken_silverman_creator_of_the/)
Mobile Home Screen with Live Preview and Source Code
https://www.reddit.com/r/programming/comments/1okges9/mobile_home_screen_with_live_preview_and_source/

<!-- SC_OFF -->Mobile Home Screen Tutorial - Live Preview With Source Code Learn how to create a stunning mobile interface with glassmorphism effects and animations <!-- SC_ON --> submitted by /u/justok25 (https://www.reddit.com/user/justok25)
[link] (https://colorbold.com/tutorial/mobile-home-screen) [comments] (https://www.reddit.com/r/programming/comments/1okges9/mobile_home_screen_with_live_preview_and_source/)
Passwordless login via email OTP is that a good option?
https://www.reddit.com/r/programming/comments/1okph9u/passwordless_login_via_email_otp_is_that_a_good/

<!-- SC_OFF -->Hey everyone, we are planning to introduce Passwordless login via email OTP is that a good option over other traditional login methods like email-password login, login with other services like Google/Apple etc. Do you have any other option which is safe, secure and quick What are you thoughts? <!-- SC_ON --> submitted by /u/Agile_Guess_523 (https://www.reddit.com/user/Agile_Guess_523)
[link] (http://devloprr.com/) [comments] (https://www.reddit.com/r/programming/comments/1okph9u/passwordless_login_via_email_otp_is_that_a_good/)
We’re trying to make code reuse actually work
https://www.reddit.com/r/programming/comments/1okpwn8/were_trying_to_make_code_reuse_actually_work/

<!-- SC_OFF -->We’ve all said “I’ll turn this into a reusable package later” - and almost never do. We built Boilerplate.com because we wanted to actually make that easy. On Boilerplate you can: Package your code once and publish it (npm/Maven integrated).
Share it publicly or privately within your team.
Even earn from it if others start using your component.
There’s also a community blog built in - so devs can share how and why they built things, not just the code.
And everything’s security-scanned before it’s published. We’re a small startup trying to fix one of the oldest dev problems - how to stop rewriting the same stuff.
Would love your feedback on whether we’re solving something you’d actually use. 👉 boilerplate.com (https://boilerplate.com/) <!-- SC_ON --> submitted by /u/Boilerplatecom (https://www.reddit.com/user/Boilerplatecom)
[link] (http://boilerplate.com/) [comments] (https://www.reddit.com/r/programming/comments/1okpwn8/were_trying_to_make_code_reuse_actually_work/)
How my Node.js code was causing a massive memory leak and how I solved it
https://www.reddit.com/r/programming/comments/1okqswx/how_my_nodejs_code_was_causing_a_massive_memory/

<!-- SC_OFF -->For the longest time, I had a Node.js server with a slow memory leak. It would creep up for days and then crash. I'd internally blame V8, thinking the garbage collector was just "being slow" or "missing things." I was completely wrong. The GC wasn't the problem; my code was. The V8 garbage collector is an incredibly optimized piece of engineering. It's just a system with a clear set of rules. The problem was my code was breaking those rules. I realized that the GC is designed for two different scenarios: New Space (Scavenger): A high-speed cleanup crew for short-lived objects (like variables in a function). It's fast and efficient. Old Space (Mark-Sweep): A slower, more methodical crew for long-lived objects (like global singletons, caches). My code was causing leaks by actively sabotaging this system: Problem 1: GC Thrashing. I had a data.map() in a hot path that created thousands of new objects per request. My code was flooding the New Space, forcing the high-speed "Scavenger" to run constantly, burning CPU. Problem 2: Accidental Promotions. I had a simple per-request cache that I forgot to clear. V8 saw these temporary objects being held onto, so it assumed they were "long-lived" and promoted them to the Old Space. My temporary garbage was now in the permanent file cabinet, leading to the slow memory creep. Problem 3: The Closure Trap. I had an event listener whose callback only needed a userId but was accidentally holding a reference to the entire 10MB user object. The GC did its job and kept the object alive (because my code told it to). Once I learned these rules, I was able to solve the problem of regular crashing for that server. I wrote a full deep-dive on this. It covers how the GC actually works, how to spot these code anti-patterns, and the practical "3-snapshot technique" for finding the exact line of code that's causing your leak. You can read the full guide here: article (https://medium.com/codetodeploy/de-mystifying-the-v8-garbage-collector-how-your-code-is-sabotaging-your-apps-memory-c290f80eb1d0?source=friends_link&sk=fc1c16b78a846500f40de8539dba7332) <!-- SC_ON --> submitted by /u/Paper-Superb (https://www.reddit.com/user/Paper-Superb)
[link] (https://medium.com/codetodeploy/de-mystifying-the-v8-garbage-collector-how-your-code-is-sabotaging-your-apps-memory-c290f80eb1d0?source=friends_link&sk=fc1c16b78a846500f40de8539dba7332) [comments] (https://www.reddit.com/r/programming/comments/1okqswx/how_my_nodejs_code_was_causing_a_massive_memory/)