Derpetology
Whatever I feel is interesting - use the white search bar or post labels to find more - see my Facebook page for other content
Saturday, May 2, 2026
The Collatz conjecture and cryptographically secure random number generators (one-way functions exist!)
The Collatz Conjecture is an iterative process with two equations whereby given any initial integer, the eventual result will be 1. No counterexample has been found since the conjecture was made in 1937 despite testing every positive integer up to and far beyond a trillion. The conjecture remains unproven. It is also impossible to predict how many iterations it will take for any starting value to converge to 1.
I believe cryptographically secure random numbers can also be made through an iterative process. Alternating the natural logarithm and sine seem to work particularly well as they consistently produce a decimal with at least 10 digits. Before explaining it further, I will give a brief overview of the one-time pad method of cryptography. This is the only encryption method which is theoretically unbreakable.
Here's how it works. First, a plaintext dictionary is made where each unique word is assigned a 4-digit code between 0000 and 9999. That gives a vocabulary of 10,000 words, which is more than enough for clear communication. In any language, a vocabulary of 6,000 words covers about 95% of what is written or spoken. When the message is being encrypted, a random 4-digit number from a pad is added to each code word. Because there are two unknowns (the code word and the random number) but only one "equation" (the encrypted message), there is no way for an interceptor to decode the message. The only times encrypted messages from one-time pads have been cracked happened when the same set of random numbers were used for multiple messages.
I don't know how the KGB generated its random numbers, but I suspect they started out with something like tables of square roots, trigonometric functions, or logarithms. Those were worked out to 4 decimal places in old reference books such as Machinery's Handbook.
The problem with trying to use an equation or a group of them to produce random numbers through iteration is if the number of digits being iterated is the same as the seed value, eventually the seed value will be produced by one of the iterations. The obvious solution to this is to make the seed value a different number of digits than the iteration values. Here are a few examples to clarify:
If I use the calculator on my phone take the sine, logarithm, or square root of almost any 2-digit number, I will get a 10-digit decimal. I can use the first 8 digits to make two 4-digit code groups and use the last 2 digits to iterate the process.
sin(10) = 0.1736481777
sin(77) = 0.9743700648
sin(48) = 0.7431448255
I get the following as random numbers: 1736, 4817, 9743, 7006, 7431, 4482.
If I iterate further, I get stuck in a loop of sin(42), sin(64), and sin(63). This pattern, I suspect, plays out for every function similar to the Collatz conjecture. It probably also plays out for any combination of functions.
For the purposes of cryptography, it doesn't matter if a function or set of functions gets stuck in a loop so long as that takes several hundred iterations to happen.
If I start with a 3-digit seed value, and alternate ln and sin, I get something like this:
ln(123) = 4.8121843554
sin(54) = 0.8090169944
ln(44) = 3.7841896339
sin(39) = 0.6293203910
With this method, it is impossible for the iteration to produce the seed value because the number of digits is different. It is possible, even likely, that this set of equations will get stuck in a loop after enough iterations. A computer program would be useful for checking that. Thus, to send an encrypted
message using this system, all the two communicants need are a shared code group dictionary, seed value, set of equations, and their phone calculators.
It would take some work to identify which combinations of equations and seed values produce the most random numbers before getting stuck in a loop. Here again computers would be useful. Finding the right combination of equations and seed values would be akin to the search for large prime numbers.
Even if the nature of the encryption algorithm was public knowledge, this method would still require a brute force attack to break. An attacker would need to try different equations and different seed values. The number of possibilities for both are very large. For example, both the functions above could be multiplied by some constant or have some value added. That would introduce even more unknowns.
I used to believe any code produced by a machine could be broken by a machine. Some algorithms really have the secret sauce. In short, one-way functions exist.
Thursday, April 30, 2026
Obi Wan tells Luke the truth
"Luke, Darth Vader is your father."
"What?! Isn't Vader the second in command of the Empire?"
"Yes, but before that he was a Jedi like me. Here's his light saber. I ganked it from him after he tried to kill me. He also killed a bunch of sand people and their children with it. To be honest, he was kind of a dick."
"Holy shit! I don't want it."
"Too bad, take it. I'm tired of lugging it around. Speaking of sand people, they probably know you're his son, so it's best to stay the hell away from them."
"How do you know all this?"
"Your father, Anakin Skywalker, AKA Darth Vader, was my apprentice. Things were going OK until this douchebag Palpatine talked him into joining the bad guys. Palpatine is now the emperor."
"So what am I supposed to do about all that?"
"I want you to fight them both. Hopefully you can kill Palpatine and redeem your father with a beatdown. It's not a great plan, I admit, but I'll help you, and it will get you off this rock you hate anyway."
"Well, I guess I'm in. What's next?"
"We hire a ship a head for a rebel base. Once we explain things, they'll make you a space fighter pilot, and you can get some combat experience. I'll also teach you about Jedi stuff like the Force. Sound good?"
"What's the Force?"
"Eh, the short answer is you can use it to move stuff with your mind, jump farther, and hypnotize dumb people."
"Sweet! Maybe I can use a Jedi mind trick to get away from my uncle."
"That's a damn find idea. Next time you see him, just wave your hand slowly in front of his face and say, 'you don't need me on this farm anymore'. When you're done doing that and whatever else you want to do here, hit me up so we can get a move on."
"What about the droids?"
"OK, so you figured out already that lady in the hologram was talking about me. Good job. Her name is Princess Leia and she's your sister. Pretty crazy, eh? Anyway, once we get to a rebel base, we can show them the hologram, we'll be in with the big shots."
"Is Jedi training hard?"
"Not really. Most of it is irrelevant or unnecessary. In hindsight, the Jedi were not the sharpest tools in the shed. That's how your dad was able to wipe out all of them except for me and this guy named Yoda."
"Yoda?"
"He's this weird little old dude who ran off to Dagobah when everything went to hell in a handbasket. We haven't kept in touch. Honestly, I think the guy is kind of useless. He might have some pointers for you though."
"How do we get to a rebel base?"
"We hire a ship from one of the local smugglers. I found this guy named Han Solo. He seems solid, and his pal Chewbacca is big enough to beat up anybody. At this point, we might as well leave right now. Imperial stormtroopers will be looking for the droids, and anyone they find along the way is in deep shit. Like I said, we should both just peace out now. I have a bad feeling already about your aunt and uncle. Sorry."
"OK. I'm ready. Lead the way, Ben."
Wednesday, April 29, 2026
how to get away with murder
THIS IS FOR ENTERTAINMENT PURPOSES ONLY.
If you want to kill someone, chances are it is someone you already know well. In that case, you will be the number one suspect unless you can make the murder look like an accident or a random killing. Thus, if you want to murder someone, it's best to do it in a big city that has a high homicide rate, so your crime doesn't stand out as much.
Let's assume your target is in a big city or you somehow lure them there. There are still the questions of how, when, and where to do it. Mob hitman Richard Kuklinski liked to dissolve sodium cyanide in a drink, pretend to be drunk and spill it on his target. The poison would be absorbed through the victim's skin. It's a cheap, simple, and ingenious method. The best part is it attracts very little attention. Drunk people in crowded bars spill things all the time. Another advantage is that since the poison takes several hours to kill, there is no need to dispose of a body.
Guns, knives, clubs etc. should be avoided because they cause injuries that point to foul play. That leads to an autopsy and a criminal investigation if the body is found which it likely will be. Accomplices should be avoided as well since they can make mistakes as well as betray you to the police. Do not try to hire a hitman unless you are already deeply involved in organized crime. Many law enforcement organizations have phony assassins-for-hire businesses to entrap the gullible. Human remains are usually found unless they are disposed of very carefully, as in the case of Jimmy Hoffa.
If your target is out in the boonies, it's to wait for them to be about to leave for a long vacation. Since they will be expected to be gone, no one will notice they are missing for a week or two, and this allows you to get far enough away after the deed is done to have a reasonable alibi. You could also wait for a snowstorm or hurricane since most people will be too distracted at the time to notice a sudden death. In this case, sodium cyanide dissolved in water and loaded in a squirt gun would be my weapon of choice. It would be easy enough to play it off as a joke and thus avoid suspicion. The lethal dosage of sodium cyanide is about 6.4 mg per kg of body weight, so you would need to soak the target's skin with maybe half a pint worth of liquid for it to be lethal.
Given the difficulties and possible consequences of homicide, consider getting revenge in alternative ways. Can you get someone fired from their job or ruin the relationships with friends and family? If so, that will likely be easier and more satisfying than killing them. The Stasi, the secret police of East Germany, rarely killed people. Instead, it tried to drive them to madness or suicide via a process of long-term harassment called Zersetzung.
Remember also that living well is the best revenge.
Monday, April 27, 2026
ecology and medical research
Nature gives clues about where to find medicines. For example, one would expect the rainforest to have both natural pesticides as well as defenses against those pesticides. The many species of cordyceps fungi are natural laboratories for pesticides, as well as other useful chemicals.
When we look at what a tree uses to defend itself from insects, bacteria, or fungi, that points the way to chemicals that could defend people and domesticated plants and animals.
Insects and rodents are useful for research because they can be bred cheaply and quickly in captivity, but still more useful would be to understand the mechanisms by which they resist the pathogens found in their natural environments.
To put it another way, many infectious diseases only affect humans, because those germs and parasites are adapted to circumvent our immune systems. I have never heard of a case of tuberculosis among pigs or HIV/AIDS in chickens. Large wild animals appear healthier still. Whales that survive to adulthood rarely die of infections. Elephants don't get polio.
Defeating a disease means augmenting the human immune system, as was done with vaccines and antibiotics. The way to forward is to carefully study the immune systems of many kinds of living things.
Bats and other flying animals have high metabolisms. This gives them an edge against viruses but often leaves them vulnerable to fungi. Why is that? What might a study of a hummingbird's immune system reveal about cancer?
These questions perplex me, and I do what I can to answer them with what I can find online.
new medicines from bacteria and fungi that infect insects?
Colistin is an antibiotic derived from the bacteria that causes American foulbrood disease in honeybees. I wonder what other medicines could be derived from the bacteria and fungi found on and in insects.
It's well known that flies, cockroaches, ants, and mosquitoes spread disease. What might they contain that could cure disease? Many insects defend themselves with antimicrobial peptides. To the best of my knowledge, none of these have been isolated and synthesized for use as medicine.
Beauveria bassiana is an interesting candidate. It is a fungus that infects many arthropods throughout the world. There has been some research in using it for mosquito control.
Nature is a wonderful laboratory. It takes a keen eye to reveal its secrets.
medicines from plants found in dry climates?
Vinca alkaloids are a well-known family of medicinal compounds from vinca plants, which grow in dry climates. Cactus too has been found to have medical uses. I suspect dry climates force plants to develop defenses for their water supply. These defenses include the spines of the cactus, but also the chemicals they produce in their roots and shoots to keep animals, bacteria, fungi, and other plants away.
I wonder about what medicinal compounds might be found in bristlecone pines, acacia, and baobab trees.
All three are found in dry climates. Olive trees are also found in dry climates. The health benefits of olive oil were known in ancient times, but what about the trees themselves?
It seems that olive tree leaves are underused as a medicine.
Subscribe to:
Posts (Atom)
