Code that helped end Apartheid
wired.com
wired.com
Ha ha ha. Yes, that was literally my very short pitch to Steven about Tim Jenkin's story!
The actual DM: "I think this has the makings of a hell of a story: https://blog.jgc.org/2024/09/cracking-old-zip-file-to-help-o... If you want I can connect you with Tim Jenkin. One time pads! 8-bit computers! Flights attendants smuggling floppies full of random numbers into South Africa!"
I also ended up sponsoring the bkcrack project because the maintainer added a new option for me: https://github.com/kimci86/bkcrack/pull/126
bkcrack.exe -k 98e0f009 48a0b11a c70f8499 -r 1..18 ?p bkcrack 1.7.0 - 2024-05-26 [11:07:33] Recovering password length 0-6... length 7... length 8... length 9... length 10... length 11... length 12... length 13...
(It was an 8088, essentially an 8086 with an 8 bit data bus, but 16bit registers and 20bit address bus).
You're quoted at the end as saying, "The code itself is a historical document". That sort of electrified me as I began thinking about what other historical code is out there in need of preservation. I'm fascinated with stuff like this, toolkits meant to be used in the field with little room for incremental development. Tracking this kind of stuff down seems like a fun hobby.
The story reads like _The Cuckoo's Egg_ in a way. Spies, intrigue, covert comms, action, revolution!
I loved that the code is still around, and works.
Kudos!!
I think it was the ANC and its activists organizing the coalition of other countries to sanction and isolate the government that ultimately caused it to yield power, which is the necessary condition for any revolution- it requires allies to be in place to support it for when it succeeds. On the ground, you only really need a few dozen people to seize some buildings and bank accounts, it's coordinating the external trade links to keep everyone paid and in their jobs while the top of the regime changes to new hands that's difficult. The opsec for that ground force just has to get most of them to their X day, where they're going to take casulties anyway.
In the case of SA, it seemed like a matter of convincing other countries to do nothing, by persuading the world the govt were just racist villains, and convincing the National Party in government that nobody would intervene to save them if there were a civil revolt. That part was organized in plain view. Opsec is interesting and mysterious, but often less important than the stories we tell about it afterwards.
That's actually a really good insight. It explains why quite a few successful revolutions – e.g. Russia and China – happened in countries _without_ an established administrative bureaucracy, and patted themselves on the based on their apparent competence in building one.
it's essentially demesquita's "logic of political survival," also distilled into the well made cartoon, "rules for rulers" https://www.youtube.com/watch?v=rStL7niR7gs
Erm.... Whut? China was (and is) _the_ example of a country held together by a civil bureaucracy. Ditto for Russia.
It's hard to stress how normal _anything_ can seem when you grow up with it. I often wonder whether, if we'd stayed (we moved to the US permanently in 1992) and if apartheid had continued, whether I'd have woken up to the reality of what was going on and become more politically active in my college years. I have no confidence my sense of right and wrong would have been strong enough to escape the stifling blanket feeling of "Well, yes, it's not right, but let's not go tooooo crazy" that pervaded political feeling in those days.
Thanks for doing this, JGC. (And now that I think of it, you might enjoy the historical spelunking in the "Georg Nees" entries on my blog at zellyn.com. Code archeology is tremendously satisfying, and getting an email from one of his sons out of the blue was a delight!)
To be honest, I was prepared to see all white South Africans as evil oppressors, and it took me a while to see that there was a spectrum -- many of whom I met -- from oppressors to opportunists to passive enablers to freedom/justice fighters.
One of my distant relatives in South Africa was decidedly racist, but mourned how his son had gone from playing with the children of black farmworkers to, after a stint in the South African Defence Forces, being a vicious white supremacist.
We could have had a very different history if they'd used DES or RC2 for encryption!
So much of symmetric key cryptography is just trying to find creative ways of creating and recreating 'one time pads' so we can distribute the key material instead of the pads themselves.
The one thing that stood out to me with the original blog post and a quick glance at the code was that it appeared as if the pad was certainly not actually random.
Could anyone that has actually understood it a bit more confirm or reject this?
Edit: It seems that the random generation can be found starting here https://github.com/Vulacode/RANDOM/blob/d6a1a1d694b22e6a115b... With three methods, one (RAND2) seems to use the basic interpreter rng more or less directly and the other two seem to be fairly simple prngs seeded from the basic interpreter's rng.
I don't actually know what the state of basic interpreter rngs was in the early '80s but I would be fairly surprised if they're anything that is secure.
That is a method though and it's basically what stream ciphers are doing, translating a key into a random stream that's then applies to the plaintext. One benefit of the true OTP though is you don't have to transfer the software and ensure it's generating the same key stream on both ends.
The difference is in the nature of the security guarantees. Almost every cryptographic primitive is "computationally secure", which means the best-known attack is to try every key, and that would take beyond the heat death of the universe. One-time pads have "information-theoretical security", which is that even if you try every possible key, you don't learn the contents of the message, because every possible message has a corresponding decryption key that will produce it from the ciphertext you are trying to break.
The reason why this is the case is because the size of the message space is equal to the size of the key space. In every other cryptosystem, you have a key space that is much smaller than the message space - say, 256 bit AES keys, or 512 bit SHA-2 hashes, for messages that can have many billions of bits in them. It's unlikely for something that wasn't the key to happen to decrypt to a valid-looking message under this scenario. But with a one-time pad, you are actually brute-forcing the message space by brute-forcing the key space. Even if you knew the hash of the plaintext, it wouldn't help. You'd just be brute-forcing whatever hash you used to find collisions.
This property goes away if you start repeating key stream bits by any deterministic process. Hence why just sending a PRNG seed is a bad one-time pad. This is also the difference between /dev/random and /dev/urandom. Linux generates randomness from a PRNG, but it's seeded by unpredictable hardware events and other sources of entropy, and there's a bunch of logic to estimate how much entropy is available. /dev/random specifically blocks until that estimate is positive, so that one-time pads and the like don't repeat bits. (In fact, this is basically the only time you should be using /dev/random! /dev/urandom is perfectly acceptable for all other cryptographic use cases!)
The generator used at the time in BASIC seems to have reseeded the PRNG automatically based on processor time and the checksum of the last block generated by the previous seed so you'd have to use some other source of randomness because you couldn't control that on disparate machines even if you changed the clock on the decoding machine to exactly match the encoding machine at the time of generation.
Instead of just using a statistically useful rand the creator of this would have had to create their own implementation of a stream cipher and that's trusting the NSA hasn't backdoored all of them which was a fear at the time. We're honestly not certain still, though the times that people were most paranoid about like the DES standard it turns out they were actually improving the algorithms resilience.
In BASIC, the word "RANDOMIZE" sets the seed for the RND function, and you'll find it's initially dependant on time (including the typing speed of the user):
https://github.com/Vulacode/RANDOM/blob/main/RANDOM.BAS#L295
It then is reinitialised periodically by mixing in run time (which is highly variable due to microprocessor limitations) and checksums of previous parts of the stream:
https://github.com/Vulacode/RANDOM/blob/main/RANDOM.BAS#L319
The RAND[123] appears to be Bennett Fox's Algorithm 647, which was designed for simulation purposes (statistical randomness), and is based on Lewis-Goodman-Miller's construction from 1969, so it had a great deal of scrutiny.
I think this would have been state of the art in the late 1980s.
Similar connotation to "decrypt" which would be exhumation.
For example, "Tora, Tora, Tora" was a code that had no intrinsic meaning, but was the signal to proceed with the Pearl Harbor attack. No way to reverse that.
Meanwhile, "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" can be transformed with a Caesar cipher to "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD". It can easily be reversed.
https://github.com/Vulacode/Articles/blob/main/Talking%20To%...
https://omalley.nelsonmandela.org/index.php/site/q/03lv03445...
I got to here before realising this is the same guy portrayed by Daniel Radcliffe in Escape From Pretoria. Great film.
If I'm understanding this right, we'd have been hosed if the files had been TARd first?
[edit] ...
This is addressed in the article. In fact the zip contained a zip and this helped!
> He realized the zip file contained another zip file, and that since all he needed was the right original text for a specific part of the scrambled text, his best chance was using the first file name mentioned in the zip within the zip.
What an amazing story!
https://www.londonrecruits.org.uk/index.php/items-received-s...
about the “London Recruits” in the 70s and 80s who smuggled books, leaflets, etc into apartheid SA on behalf of the ANC, doing so in such secrecy they didn’t know each others identity until 29 years after the apartheid regime fell.
Joy Leman, one of the recruits, was my late father-in-law’s colleague.
My understanding is Mandela was a respected leader who was willing to play ball and facilitate a peaceful transition where the white leadership got to keep all their property. That's why there's still massive economic inequality in SA today. Not to say Mandela wasn't admirable or that he didn't suffer, but it was a conscious choice to avoid outright military conflict at the cost of preserving an implicit racial hierarchy.
Take North Korea, say, another extremely nasty rogue nuclear-armed state. Even if there was a level of pressure that the international community could put on North Korea that would collapse it (it's already pretty far down the 'autarky' route), you can see that countries would be unwilling to go quite _that_ far, because there's no viable opposition and it would likely collapse in a very dangerous and ugly way.
Though to be fair none of these had happened prior to apartheid.
To me, the peaceful transition is the achievement. It is the amazing part of it.
South Africa also has affirmative action.
In fact, there are more race based laws in South Africa currently than during Apartheid.
https://freemarketfoundation.com/race-law-in-south-africa-30...
Now maybe you're talking about violent wealth redistribution. That generally doesn't work. It results in collapse and everyone gets poorer.
Zimbabwe bring the prime most recent example.
If you say that you are going to take large amounts of other people's assets, there is no way to run that process and not have huge amounts of corruption.
The problem has been: very high crime, heavily mismanaged infrastructure (Eskom is collapsing due to corruption, ANC politicians were taking tons of money from contracts), no investment in education, and so a population with no skills. I am not sure what wealth redistribution fixes...it has been tried repeatedly. It is like people thinking that a $1m loan from your father turns you into a different person...no, most people will end up wasting that money too.
> To me, the peaceful transition is the achievement. It is the amazing part of it.
Apartheid was "peaceful" enough. The problem is the lack of "transition." The same people are still living in the shacks their parents lived in.
> that's why non-South Africans look on Mandela so fondly.
Non-South Africans had a lot of cognitive dissonance because they did business with South Africa and they didn't like what that said about themselves morally. The end of Apartheid gave them the license to continue that business guilt-free. It's like how sharecropping debt peonage to the same plantations that people were enslaved in and the leasing of convicts who had been sentenced to decade-long sentences for the crime of vagrancy let Americans feel better about how much they benefited from slavery.
First, there was significant pressure on de Klerk from Western governments. Thatcher told him to release Mandela, for example. The reason she did not support sanctions is because they would likely harm South Africans for no reason...this was justified by later events. As pressure on de Klerk would have made it a lot harder to negotiate with Mandela freely.
Two, de Klerk became leader and his first action was to try to form a path to reconciliation. Mandela played his part by abandoning terrorism (I am not sure why this is disputed...this is what Mandela said about himself). de Klerk's position was, however, not particularly easy because whilst everyone acknowledged that the system had to change, it wasn't clear how to get to that point.
Three, the article implies all white South Africans were racist...this is not true. This assumption is not why apartheid happened either. de Klerk was not Botha. The US experience dominates the world, the assumption that everyone in the NP was racist is not accurate...let alone saying everyone of a certain race must have been racist.
Four, there has been massive upheaval. The economy of South Africa has collapsed, and the ANC did seize property under the auspices of BEE. Large companies were told they had to hand shares to ANC members or they would be shut down, these companies then took out loans to buy back their shares. The current President was a friend of Mandela, union leader, he was then gifted hundreds of millions in shares...that is how he became wealthy (and, if you can believe it, he is the "anti-corruption" guy).
Five, the reason there wasn't bloodshed because there was a transitional period. This was agreed by both parties, this is why Mandela wins plaudits for recognizing that NP had legitimate concerns that had to be taken into account to move forward. But...this still hasn't stopped the country collapsing.
Six, the argument that there must still be racism because of economic inequality is a uniquely US take. The ANC expropriated wealth en masse, the majority went to party insiders, and there has been almost no interest in serious economic policy-making because...the country is majority black, and the ANC are the black party. The reason people are poor is because there is no education and so they have no skills, crime is also out of control...this doesn't have anything to do with someone else not being poor (and btw, almost everyone in South Africa is now poor, the currency has collapsed, everything has collapsed, there is so much corruption that electricity cuts frequently...yes, those white people again though...this is why Malema is popular).
Seven, it was reasonable for de Klerk to be wary. What happened to Rhodesia? Everyone has this idea that everything would be fine, just trust Mandela...okay, there is a country next door where you saw whites being slaughtered en masse when Zanu-PF took power. The country has still been ruined, but that didn't happen at least.
There wasn't any international pressure. There was a withdrawal of the continual and embarrassing support from Britain and the US, the only people other than Israel who hadn't been overly troubled by Apartheid. First from Britain, because as bad as she was, Thatcher was nauseated by Apartheid, then from the US who would have had to actively intervene (as they are right now in a similar context) in order to preserve Apartheid. This was only 25 years after the US had ended its own legal Apartheid.
The US political class was largely indifferent to Apartheid (aside from periodic expressions of mild disapproval of both sides and condemnation of Communist-backed terrorism), so when they saw how the wind was blowing within SA ("fear of a civil war"), and that individual domestic politicians could be damaged or gain politically through their actions towards SA, the US supported the "coup" (as always) so they could keep doing business without interruption.
So I'd instead say popular pressure among citizens of the US and Britain against their own politicians, and the resulting withdrawal of Anglo-American support. Everything else but "international pressure" I agree with totally.
In particular:
- There's no racial segregation laws; an Arab-Israeli can travel anywhere a Jewish-Israeli can. In fact, Arabic is an officially recognized language by the state of Israel, and throughout the country, every public service has signs in Arabic alongside Hebrew.
- Jews are not a minority in Israel, they comprise 78% of the population.
That is simply not true. E.g. The city of Hebron is segregated by religion - see https://youtu.be/Z42HhaywhGQ?si=bTBhEFi5lgBJQX9v
According to Human Rights Watch[1], Amnesty International[2], and many other human rights organizations, the regime in Israel today is in fact recognized as a system of apartheid. Mandela himself shown a lot of solidarity to the palestinian cause[3].
[1] https://www.hrw.org/report/2021/04/27/threshold-crossed/isra...
[2] https://www.amnesty.org/en/latest/research/2022/02/qa-israel...
[3] https://www.middleeasteye.net/news/nelson-mandela-30-years-p...