CloselyChunky | 4 years ago | on: Backdooring Rust crates for fun and profit
CloselyChunky's comments
CloselyChunky | 4 years ago | on: EvilModel: Hiding Malware Inside of Neural Network Models [pdf]
CloselyChunky | 4 years ago | on: GitHub Copilot
CloselyChunky | 4 years ago | on: NixOS 21.05
CloselyChunky | 4 years ago | on: Automatically Make Unit Tests
In response to this, I recommend the "Functional Core, Imperative Shell"[0] talk/pattern. The idea is to extract your business logic as pure functions independent of the data access layer. This pattern allowed me to test large portions of a code base using property tests. This works really well in most cases and gives me much more confidence in the product that will be deployed.
[0]: https://www.destroyallsoftware.com/screencasts/catalog/funct...
CloselyChunky | 4 years ago | on: Exploiting vulnerabilities in Cellebrite UFED and Physical Analyzer
CloselyChunky | 5 years ago | on: DIY Camera Using Raspberry Pi
In general, film photography is having a comeback. Prices for used film cameras skyrocketed in the last years for a few models.
Personally, I find photographing on film really rewarding. Having a physical product in the end (be it a print of the image or only the negatives) makes the process more enjoyable. So if you have some old film cameras lying around, I can only recommend giving them a try. Maybe there are even old films with old memories in these cameras.
CloselyChunky | 5 years ago | on: Using the switch(true) pattern in JavaScript
validators.reduce(Either.right(user), (acc, next) -> acc.flatMapRight(next))
This way you'll end up with either the validated user, or the first error that occurred and all the other validators were skipped.CloselyChunky | 5 years ago | on: Using the switch(true) pattern in JavaScript
Then iterate over the tuples, if a predicate fails, return the associated error message and throw an error/display the message to the user.
In the end it looks something like this:
var validators = Stream.of(
Map.entry(user -> user != null, "User must be defined"),
Map.entry(user -> user.firstName != null, "Missing first name"))
validators.filter(e -> e.getKey().apply(userToBeValidated)).map(Map.Entry::getValue).getFirst()
(This example uses Map.entry for tuples as Java lacks native support for tuples)This limits branching and you have all validation criteria neatly organized in the same location.
CloselyChunky | 5 years ago | on: Using the switch(true) pattern in JavaScript
_ = isDefined(user) || throw new Error("user must be defined")
This reads way more natural for me. "A user is defined OR throw an error"...I've also seen this in Perl (`do_something() || die()`) and shell scripts (`grep -q || die "not found"`).
CloselyChunky | 5 years ago | on: A Brief F# Exploration
CloselyChunky | 5 years ago | on: Have I Been Facebooked?
Still, if I had to chose between hibf.com and hibp.com, I'd lean to hibp.com since Troy is a known name in the industry and has offered this service for a long time without any complaints.
CloselyChunky | 5 years ago | on: Have I Been Facebooked?
CloselyChunky | 5 years ago | on: Have I Been Facebooked?
Edit: I just checked, seems like the form on the frontpage of HIBP also submits your complete email/phone number. Pretty sure I read about how you don't have to submit your personal data to validate against HIBP, not to long ago...
[0]: https://github.com/Fumaz/haveibeenfacebooked-api/blob/master...
CloselyChunky | 5 years ago | on: VPNCloud: Open-source peer-to-peer VPN written in rust
Including my RPI (running PiHole in my LAN) into the tinc VPN gave me an easy way to access my home network from anywhere in the world. One of my dedicated servers would automatically take care of routing the traffic and I can just `ssh [email protected]` to connect to the RPI and be inside my home network.
IIRC tinc implements some tricks like TCP/UDP hole punching. So best case I end up with an actual p2p connection between my remote device and home network after connecting via tinc.
CloselyChunky | 5 years ago | on: Fictional Cryptocurrencies
This is not true. Bitcoin energy consumption is somewhere between Chile and Argentina.
CloselyChunky | 5 years ago | on: Show HN: I built a hash-identification system with popularity ratings
One-way functions are functions that are easily computed given any input but where it is hard/impossible to compute the/a input if you only know the output. This is the property of hash functions that we make use of when hashing passwords, generating signatures, validating files and so on.
We assume that hash functions are one-way functions but to prove the existence of one-way functions is one of the big unsolved problems in computer science. Additionally it has been shown that if one-way functions exist, that P != NP.
With that in mind, we cannot confidently say that "Hashes cannot be undone". While it might still be impossible to find the exact input that was used (unlimited input range vs limited output range), it would be possible to find a possible input resulting in the output you are looking at.
The Wikipedia article [0] is a good starting point for more information.
CloselyChunky | 5 years ago | on: Show HN: I built a hash-identification system with popularity ratings