Friday, July 18, 2014

Cracking AES or RSA encryption using light

AES and RSA encryption rely on determining whether a large number is prime.  This is hard in the sense of computational difficulty since it takes a long time to determine whether, say, 23409283889381 is prime.

You can try dividing 23409283889381 by every integer below it greater than 1, and seeing if there's a remainder.  This is called "trial division" and would rely on fast methods of computing 'mod' function.

Like this:

5 mod 3 = 2
10 mod 5 = 0


If we have X mod Y = 0 then Y divides X and X is not prime.

Fast computational methods use the 'crossoff method' where we list all numbers in sequence and then cross of multiples of 2:

2,4,6,8, ...

then multiples of 3:


The 'holes' left over, i.e. 5, 7... are prime.  This is the basis behind various sieving methods.  Fast algorithms use the crossoff method since processors are better at multiplying than dividing.

Regardless, though, the crossoff method running with a 3.0 GHz processor and a lot of ram still takes a lot of time and couldn't possibly reach the large numbers that are required to crack 1024- or 2048- bit encryption.

Imagine, however, there were a setup of Young's double-slit experiment where we shine light (or a laser) at a small hole.  The effect is a set of parallel lines of light.  Now if these parallel lines of light are evenly spaced, and we measure the distance to each of the lines of light from, say, the left- hand side, and say the distance between the lines was 2 mm then we would have light lines at 2,4,6,8, corresponding to the multiples of 2,4,6,8 as above.  If we changed the distance of the light to the hole and the frequency of the light, we could get parallel lines spaced evenly apart at 3,6,9,12,15, mm.

If we then set up a reel of blank film (like in a camera) and exposed the light onto this film we would be able to very precisely tell where the holes (primes) are.  The accuracy of doing this would be limited only by how accurately our light rays and film could be - possibly to the molecular level or even atomic level.  If it's on the atomic level, then there's 127,000,000 units in one inch of film.  That's not nearly enough, though, to scale to what we need.  (We'd need a whole bunch of film).

Photons of light, however, don't have size.  And there are more advanced methods using lenses and optics and interferometry to do this (without film!), although I'm not a specialist in constructing such a thing.

The point, though, is that light travels infinitely fast so effectively the multiply operation takes zero time, and so does modulating the interval between integers (if many lights or many frequencies of light are shined simultaneously).


Oh whoops - these guys found this out first in 2009 I guess!

J.F. Clauser, J.P. Dowling, "Factoring integers with Young's $N$-slit interferometer"(preprint 10/2009)
[abstract:] "We show that a Young's $N$ slit interferometer can be used to factor the integer $N$. The device could factor four- or five-digit numbers in a practical fashion. This work shows how number theory may arise in physical problems, and may provide some insight as to how quantum computers can carry out factoring problems by interferometric means." 

Monday, October 7, 2013

NFL Cheat Sheet

  • Quarterback (QB) is the guy who throws the ball
  • Receiver is the guy who catches the ball
  • End Zone are the two painted regions at the end of the field
  • A Play is when a team tries to gain yards or score a Touchdown or Punt the ball.
  • Touchdown is when the receiver catches the ball either in the End Zone or runs it into the End Zone after catching it. Touchdown could be any player who is in possession of the ball in the End Zone.
  • The objective is to score more points.
  • The objective is just like soccer or hockey or any other sport.  (Soccer fields are roughly twice the area of Football fields).
  • There are 4 Plays, also called Downs. 1st, 2nd, 3rd, 4th Down.
  • On 4th Down the other team gets the ball. The other team has the ball.
  • If a Player in possession of the ball is downed by having their elbow or knees hit the ground, they're down(ed).
  • Usually a team will Punt (kick) the ball as far as they can toward the End Zone on 4th Down
  • Touchdown gets a team 6 points.
  • Field Goal is when the Kicker kicks the ball through the Goalpost. It gets a team 1 point after a Touchdown. This is also called a P.A.T. (Point After Touchdown).
  • Field Goal gets a team 3 points if not preceded by a Touchdown.
More technical
  • Two Point Conversion is when another Touchdown is substituted for a Field Goal after a Touchdown.
  • Positions in Football are a lot like chess positions - and learning them is just like learning a rook, knight, queen, etc. except that the positions move in real time during play.  There are only certain Players who are eligible receivers.
  • Each team has an Offensive Team and a Defensive Team.  One team's offensive team plays the other team's defensive team.  After a change of possession a team's defensive team plays the other team's offensive team.
  • An Eligible Receiver is a Receiver who is allowed to catch. It’s positionally based - that is, where he lines up.
  • Also many of the positions are filled by fearsome 350-lb men who grapple and tackle each other. (Kicking is not allowed. That’s some pussyfoot shit).*

(From: Wikipedia on NFL formation)
  • The Line of Scrimmage is where the offensive team lines up before a play starts. The ball is placed on the Line of Scrimmage where it was last downed.
Offensive Team
  • The Offensive line consists of the center (in the center), the guards (left and right of center), the tackles (left and right of guards) and the tight end on one side and one wide receiver on the other and one other wide receiver on the other.
  • Lineman is one of the (TackleGuardCenterGuardTackle) in the diagram above.
  • Running Back is the same as Tail Back is the same as Half Back (they’re all synonyms).  Their responsibility is to run the ball forward, block, and catch.
  • Tight End (TE) is an offensive end who lines up next to or close to the tackle. Tight End sometimes lines up like a Fullback.
  • Wide Receiver (WR) is a type of Receiver who stands at the Wide (Far Left or Far Right) part of the Offensive Line.  They catch the ball and need to be fast and agile, like sprinters.  They catch long passes.
Defensive Team
  • Defensive Side lines up opposite to the Offensive Team along the Line of Scrimmage.
  • Defensive Back is either a Safety or Cornerback.
  • Defensive Safety is just a Safety. (There is no Offensive Safety).
  • Cornerback on the Defensive team covers the Wide Receiver on the Offensive team.
Even More technical
  • A Cover 2 defense is a widely-used defensive strategy and is probably the best type of defense in the NFL.
  • A ‘Flex’ (Fantasy only) is a running backwide receiver, or tight end.
  • The wide part of the field is either the left or right part of the field.
  • Quarterback throws to the Flats which is a 0 to 2 yard region just behind the Line of Scrimmage on the wide ends of the field on the Defensive sides.
  • Foxboro is the arena where the Patriots play. Patriots are the team for New England. Patriots were coached under Coach Bill Parcells before gaining Tom Brady as backup Quarterback behind Drew Bledsoe, and winning the Superbowl in 2002. See: Kicker Adam Vinatieri.
  • Bill Parcells is not a bad Coach. He later coached for the Cowboys who are a team for Dallas, Texas and performed admirably.
  • The current coach for the Cowboys is a fellow named Jason Garrett
  • Colts are the team for Indianapolis
  • Bears are the team for Chicago
  • Broncos are the team for Denver
  • Peyton Manning is the Quarterback for the Broncos and is doing great right now. (as of the 7th week of 2013 NFL season).  He's injured, though. Peyton Manning used to play for the Colts.
  • Brett Favre was the Quarterback for the Vikings and the Green Bay Packers. He also used to play for the Jets. He is famous because his career lasted a long time and he remained a decently performing Quarterback.
  • Saints are the team for New Orleans.
  • 49ers (Forty Niners) are the team for San Francisco.
You do not have to know much about NFL Football before the 1980s because no one cares. Many of the rules have changed since then.

* Pussyfoot shit: like when kids kind of nudge each other - that’s pussyfooting.

Monday, February 4, 2013

How to pilot an airplane through turbulence

Let's say we're approaching a headwind @ 30 mph (or maybe 100 knots). Our ground speed, headed in the direction into the headwind is 550 mph. If we turn around, our new 'tailwind' will make us go 650 mph, over the ground.

The question to the pilot: how does airspeed and turning around in a big circle relate to each other?

A: ignore the airspeed as you make the circle or whatever shape. The airspeed needs to be in a range that is critical to flight itself. If the airspeed is too low, the airplane will stop. If the airspeed is too high, the wings will get ripped off (damage to airplane, hairline fractures, damage the airplane).

The key to understanding this is that you measure wind speed, you don't try to counteract it.

Q: When you're up in the air, and you're making turns, if you set the power at a given setting (not going to change the power, try to climb, try descend) then that would change the airspeed field as felt by the airplane. Try to dive, airplane's going to speed up.

If you stay level, and you don't change up/down, not messing with throttle, then the airspeed is going to stay the same. (Airspeed should not to be confused with turbulence).

As you are turning, into or outside of the headwind, your airspeed will not change, unless you do something to change it. The ground speed will change tremendously. Your former headwind will become a tailwind.

The wind will make your idealized circle, as you fly it, end up like a spiral of some sort, or squiggly hair since you can't pull a perfect circle and remember where you were, over the ground, unless you track the airplane from an overhead satellite, and have a Computer driving 'the perfect circle' (i.e. constant adjustments, throttle, angle of bank, etc.)

To date, no civilian aircraft is supposed to fly into a hurricane because there is a lot of turbulence and shear forces that could rip apart a plane.  Only specialized military aircraft do this, although the pilots of civilian aircraft are all largely ex-military flyers.

Vietnam Marine Protips

I had the opportunity to sit next to a US Marine Veteran today on my plane flight. He is also an engineer for ground GSE (ground support equipment) for United Airlines.

David Jones* served 4 years 1964-1968. He was deployed in the Marines (the infantry of the Navy), 1st battalion, 5th marines. His training consisted of: 11 weeks Bootcamp, 30 days leave, 7-9 weeks of infantry training. He fought on the front lines of the Mekong Delta - south of Saigon - which all happened before the Tet Offensive. The Tet Offensive was essentially a brutal, all-unified attack using all jungle fighting techniques, where North Vietnam, without warning, attacked South Vietnam. North Vietnamese actually do know terrain fighting, much better than US at the time.  The North Vietnamese knew techniques of shooting down helicopters (via surface to air missle).  They also knew the location of landmines.

Bootcamp is required for qualification to use weaponry. (An M-14 rifle 7.62m NATO round. Interchange the ammunition). M-1 rifle 30-caliber, used in WWII, and Korea. Upgraded it to M-14. Automatic rifle. M-1 could fire 6 rounds as soon as you can do it. M-14 can empty 20 rounds in a magazine as fast as you can pull the trigger, one round at a time.

Each squadron has 4 guys. 1 in 4 has a 'selector switch.' to toggle between semiautomatic & automatic. Why? Instead of mowing down your enemy with a fully automatic rifle, a semiautomatic lets you conserve ammunition (you don't have infinite ammo, and if you run out, you are screwed).

Compared to modern-day warfare, there was almost zero interaction at the time (unlike Iraq and Afghanistan) with locals. No civilian interaction.

Prior to the advent of MRE (meal ready-to-eat) C-rations were eaten. C-rations amounted to sporked spam and any other canned food you could cram into a can. After a long day of fighting, wading through swamps, etc. "that shit tastes like steak," according to Dave.

Apparently, back in the day, you could get ANYTHING (black tar heroin, cocaine, meth, pot, amphetamines, anything you wanted) from Subic bay, Phillipines.  Subic bay is the base, the town is Olongapo.

The North Vietnamese had some clever tricks up their sleeves, for weapons.  A 'panji' stake is where you dig hole in ground leave a stick tip dipped in buffalo dung (so you get infected), then you'd step on it, infected - there goes your foot.  A 'Mayalan gate' - gate of spikes, you step somewhere, you get impaled.

Q: Which bases were you stationed at?
A: Da Mang, Nang, Chulai, Kasanah.

Q: Where did you learn how to fight?
A: Jungle fighting techniques were learned in kahanoe hawaii and Subick bay, Phillipines.

Q: What about landmines?
A: Dave has seen someone from his platoon step on a landmine.  They didn't survive.  Dave himself was once driving a truck, when it  ran into another landmine. The Back end of truck got blown away.
There are two types of landmines, each having a different delay trigger.
A 'Claymore' - could see the top of a claymore - would fire in every direction.
'Bouncing Bettys' - fly up 6 feet in front of you, then explode.

There are also guys who would find and disarm landmines.

Q: Who are the bravest people in combat?
A: Corpman - army's version of a medic. They have to do medical assistant on the front lines.  All they had was a .45 caliber pistol and a medical kit. How would they stretcher people out? A: any way they could.

Q: What were living conditions like in the jungle?
A: A 'Shelter half' is half a tent. Each guy's got a half, share a traditional tent with two guys.

Q: How did combat in Vietnam compare with the Korean War?
A: Similar to korean war. but not the same. WWI WWII had fronts. korea had fronts, but there was envelopment. Scattered pockets of enemies. 50 over here, 1000 a large number of miles away.  Jungle combat is different.  Nowadays we fight wars in the urban locations (towns, cities).

Q: Do the marines have air vehicles?
A: Yes.  Marine corp has an airwing - flying helicopter, f4 phantom fighter jets ('F4 phantoms').

Q: What are some professional tips?
A: key to surviving in the jungle: be calm. Accept that you're there. Don't get too excited.

Q: Where did the term 'charlie' or 'gook' come from?
A: The term 'charlie' was any of them: north vietnamese regular, vietcong, vietcong is a south vietnamese that sided with the north.  To marine corps: gook to anyone with non-rounded eyes.  'Luke the gook' is from a Paul Newman movie 'Cool Hand Luke' - the name for a vietcong. VC. lukie.

Q: What was your greatest fear?
A: Never would allow yourself to be captured (unlike McCain) - the biggest fear is getting captured.

* Name anonymized

Friday, January 18, 2013


One of my friends works in a doctor's office here in Central NJ.  You get a lot of Telugu staff speaking English.  Some of the constructions she's noticed over time:

1) repeat words, like the following: "different different"
2) repeating numbers, like the following: "one one" "two two"

I tried to answer this as much as I could using google translate.

1)  different = వివిధ = various.  So adding particles or chaining together these words could imply various or sundry, misc?

2) I have a hypothesis that this may be due to a number being substituted in for an expected measuring word, so things like "a" could be doubling as "one," like someone saying "a one ball" or "two pair balls" or something like that.  Instead, I got the following:

"I threw a ball" = నేను బంతి విసిరిన = "I ball"

weird.  Telugu and back simply drops the entire threw?  Maybe because of 'throw.'  Hmm...

"I throw two balls to you." = నేను మీకు రెండు బంతుల్లో త్రో. = "I'll throw two balls."

"he has two two shots remaining"

= అతను మిగిలిన రెండు రెండు షాట్లు ఉంది = The other two are two shots that he
ఇతర రెండు రెండు సన్నివేశాలు అతను = He and the other two by two shots
అతను మరియు రెండు షాట్ల ఇతర రెండు =

"He and two shots of the other two"*

Now, if we remove the second 'two' (and make the message contain less ambiguity) we have exact resonance between the following two statements:

"he has two shots remaining" = అతను ఇతర రెండు షాట్లు ఉంది = "He is the other two shots"**


Here's an update on the Telugu theory.  I looked this up on Wikipedia:

Number system

Telugu has its own digits, as shown below.
sunna ( distorted form of sanskrit word shoonyam )okatirendumoodunaaluguaidhuaarueiduenimidhithommindhi

So my current theory is that 'two-two' or 'three-three' as spoken in english might be attempting to mimic the number of syllables of the base language's number.  Perhaps the rhythm (and number) of the particles, e.g. ren-du is of a more fundamental layer of understanding and encoding in language than are the sounds of the syllables.

Separately - might this be a reason why some tabla music is based on sequences that don't divide into the same modulus as the rest of Western music (mostly 4s).

* Cycling a message to be encoded and decoded between English and a target language, I think, is a way of simulating how it might be learned by either, for better or for worse

** Who knows why these two phrases resonate.  Maybe "he has two shots remaining" = "He is the other two shots" because "he has X remaining" -> "he only has X remaining" -> "he is composed of X" -> "he is composed of two shots" -> "He is the other two shots"***

*** notice 'is' is italicized, 'the other' is italicized and bolded as denoting the only difference between these two constructions.  I thought this was kind of cool, also because it represents the purest of existential choices - existing as I and existing apart from 'I'.

Monday, January 7, 2013

Throwing your voice into a hidden room

I just read a cool article that experimented with voices coming from a ceiling here.  Here's another experiment I set up recently, in my house, to experiment with voices heard on the other side of a wall.  It's like a magic trick.

1) set up a laptop A against a physical wall.
2) hook up laptop A’s sound output to a bluetooth speaker on the other side of the wall.*

3) set up a google hangout between laptop A and another laptop located in another room B against its wall.

With this setup A looks like a window on the wall, looking into B. It also sounds like the conversations in room B are being overheard by you as if the people in room B are speaking to each other on the other side of the physical wall. The result is the feeling that room B and room A are on opposite sides of a real wall, but the sound tricks you into thinking people are conversing just on the other side of a wall, with the sound spilling into your room from the hallway outside.

n.b. #1: This is more useful for voyeurs than it is for people looking to communicate between the two rooms.

n.b. #2: I came up with this experiment after watching "The Lives of Others" and then setting up this quick experiment to "peer" from my kitchen into my living room, during the NFL playoff game last night.

n.b. #3: I read here that this may be just another configuration of "telepresence."

* or, locate the bluetooth speaker on the other side of the door to the hallway, although this isn't as effective