Thursday, December 12, 2013

Battery History


The following are notes on battery history
  • History of Batteries
    • 2000 years ago Baghdad battery
      • created in Mesopotamia 
      • Jar of ceramics created with a speculated structure of copper with walls of iron
      • if filled with unknown composition of electrolytes meets the requirements for a battery
      • Maybe used to plate gold onto silver?
    • 200 Years Ago Animal Electricity
      • Galvani while doing a dissection a steel scalpel touched a brass hook that was holding a frog leg in place
      • Battery composition
        • Steel scalpel has iron 
        • brass hook has copper
        • preservatives acted as electrolytes
  • First Battery
    • Voltaic Pile 
    • set of individual galvanic cells placed in series
    • copper and zinc stacked together with electrolytes sandwiching the two metals
  • History of electrochemical energy storage
    • Galvani
    • Volta - Voltaic Pile 
    • Daniell - Zn/Cu Cell
    • Faraday - Basic Principles of electrochemistry
    • Grove - H2/02 cell
    • Plante - Lead Acid Cell
    • Leclanche - Zn Carbon dry cell
    • Edison Zn/Ni and Fe/Ni cells
  • Modern Batteries
    • modern development started around half a century ago
    • Solid Electrolytes
      • 1966 Yao and Kummer Beta Alumina Solid Electrolyte: Fast Na Ion Conductor
      • birthed solid state ionics
      • Rubidium silver iodide
    • Internal Phenomena
      • Whittingham steele insertion reaction electrodes
      • created Le/TiS2 cells
      • Sony commercialized the first Lithium ion batteries

Friday, December 6, 2013

Notes - The ElGamal Public Key Cryptosystem

The following are notes from Introduction to Cyrptography with Coding Theory.
  • ElGamal Public Key Cryptosystem
    • Alice wants to send a message m to Bob
    • Bob chooses a large prime p and a primitive root α
    • Bob chooses a secret integer a and computes B ≡ α (mod p)
      • Make public (p, α, B) and is Bob's public key
    • Alice
      • downloads (p, α, B)
      • Chooses a secret random integer k and computes r ≡ α (mod p)
      • Computes t ≡ B k m (mod p)
      • sends the pair (r,t) to B
    • Bob decrypts by computing tr -a ≡ m (mod p)
  • Security
    • depends on a being kept secret which is reliant on the idea that discrete logs are difficult to compute

Notes - Discrete Logarithms

The following are notes from Introduction to Cyrptography with Coding Theory.

  • RSA Algorithm relies on the difficulty of factoring, but we can also use the difficulty of discrete logs
  • Fix a prime p. Let α and Β be nonzero integers mod p and suppose
    • Β ≡ αx (mod p)
  • It is difficult to find x assuming we choose a large enough prime
  • α is taken to be a primitive root mod p so that every Β is a power of α (mod p)
  • The size of the largest primes for which discrete logs can be computed is usually about the same size as the largest integers that could be factored
  • This means that discrete logs are another example of one-way functions
    • where f(x) is easy to compute but given y it is computationally infeasible to find x

Thursday, December 5, 2013

Notes - An Application to Treaty Verification

The following are notes from Introduction to Cyrptography with Coding Theory.
  • This method will essentially describe the RSA signature Scheme
  • Example
    • Countries A and B have signed a nuclear test ban treaty
    • Country A wants to verify the treaty by placing sensors in B
      • Country A wants to ensure sensors are sending correct data without tampering
      • Country B wants to look at the message before its being sent to ensure that espionage data is not being transmitted
    • A chooses n = pq to be the product of two large primes and chooses encryption/decryption exponents e and d
    •  n and e are given to B but p q and d are kept secret
    • sensor collects data x and uses d to encrypt x to y ≡ xd (mod n)
    • both x and y are sent to country B to check that ye ≡ x (mod n) and then to Country A to ensure that the number x has not been modified. If x was modified it would be the same difficulty as decrypting the rsa message x

Notes - The RSA Algorithm

The following are notes from Introduction to Cryptography with Coding Theory.
  • Public Key Cryptosystem
    • Presented by Diffie-Hellman
    • Goal - allow Alice to send a message to Bob without previous contact and without the use of a courier to exchange a key but protect the message from Eve a potential attacker
  • The RSA Algorithm
    • Bob chooses secret primes p and q and computes n = pq
    • Bob chooses e with gcd(e, (p-1)(q-1)) = 1
    • Bob computes d with de ≡ 1 (mod(p-1)(q-1))
    • Bob makes n and e public, and keeps p, q, d secret
    • Alice encrypts m as c ≡ me (mod n) and sends c to Bob
    • Bob decrypts by computing m ≡ cd (mod n)
  • Example of the RSA Algorithm
    • p = 885320963, q = 238855417
    • n = p * q = 211463707796206571
    • Let the encryption exponent be e = 9007
    • Let the sample message m be 30120
    • c  ≡ me ≡ 301209007 ≡ 113535859035722866 (mod n)
      • Where c stands for the ciphertext Alice is sending to Bob
    • Bob knows p and q so he knows (p-1)(q-1) then he uses the extended euclidean algorithm to compute d such that de ≡ 1  mod (p-1)(q-1)
    • d = 116402471153538991
    • Bob computes cd ≡ 113535859035722866116402471153538991 ≡ 30120 (mod n) to obtain the original message

Tuesday, November 26, 2013

Battery Applications and Parameters

The following are notes on Batteries for their common applications and parameters
  • Battery Applications
    • Portable Applications
      • Portable electronics, laptops, iphones, toys, medical devices
      • battery used to start engine in cars is the largest market
        • lead acid and lithium ion
      • High energy batteries, highest energy for given size
    • Stationary Applications
      • Pairing with with intermittent sources of electricity
      • high energy is less important
  • Common Forms Factors of Batteries
    • Button Cells in Watches
    • Cylinder Cells
    • Lithium Ion
    • Prismatic Cells
  • Sizes of Batteries
    • 4.5-volt (3R12) battery 
    • D Cell
    • C cell
    • AA cell
    • AAA cell
    • AAAA cell
    • A23 battery
    • 9-volt PP3 
    • button cells
  • Types of Batteries
    • Chargeable or non-chargeable
    • Battery Chemistry
      • Alkaline 
      • Lead acid 
      • NiCd nickel cadmium
      • NiMH nickel metal hydride
      • Lithium ion
  • Important Parameters of Batteries
    • Energy (Watt Hour)
      • Energy Density - Energy Per Unit Volume
      • Specific Energy - Energy Per unit Weight
      • Characterize the total amount of energy it carries, lifetime of battery once you charge it up, distance of electric car
    • Power (Watt)
      • How fast you can take the energy out of a battery
      • Power Density Power per unit volume
        • Example more important for Laptop, fitting into size constraint for a high usage device
      • Specific Power Power per unit weight
        • Car, heaviness of battery impacts performance
      • Life
        • Cycle Life, times we can charge and discharge a battery with its capacity still above 80% of the original
        • Calendar Life Time a battery can last if left on shelf
          • Electrical car ensure it can last for about 10 years?
      • Safety
        • Battery intrinsically is in unstable state
      • Temperature Performance
      • Cost
        • Currently its difficult to justify batteries for cars and grid use

Electrical Engineering ToC

Table of Contents


  1. Batteries
    1. Battery Applications and Parameters
    2. Battery History
  2. Digital Design
    1. Finfet

Thursday, November 21, 2013

Notes - Sustainabiltiy and Energy Storage Stystems

The following are notes on the sustainable energy sector and the potential of energy storage technologies.
  • Sustainability
    • Energy storage is useful in order to balance the grid
      • grid balancing is making sure that the amount of energy being produced by the grid is equal to the amount of energy being used by it
    • Issues it solves
      • As the amount of renewable sources continue to increase, the fluctuating nature of the energy production means that we will need to capture any "excess production" in the case that renewable sources produce too much energy
      • This becomes profitable if storage beats the costs of turning on and off other generators such as coal, gas, etc.
    • Issues facing growth of industry
      • We would require variable renewable sources to generate greater than about 20% of our electricity in order for this to become viable
        • variable includes wind/solar, production dependent on variable sources
        • non variable renewable includes hydropower, biomass, geothermal because their sources are controllable


      • As is clearly shown in the above solar amounts to .12% of our total energy production, and wind amounts to 3.36% for a total of about 3.48%
        • Solar although it is a rapidly growing field is still dependent on subsidies, although this may soon change, something needs to change in the market in order for there to be an increase in buyers
        • Wind is completely dependent on government subsidies. There is near 0 production when subsidies are taken away, so wind development relies on smart governmental decisions
          • Cue Government shutdown
        • Additional Complications
          • there is steep competition given by China which has better economies of scale as they are investing heavily into the older silicon based solar which is cheaper to purchase
            • Note China as a whole is not yet profiting, but they are gaining a powerful grip on the market
          • US is "going big" in solar arena by increasing efficiency of their cells
            • this would need to be coupled with trends i.e. requires help from mainstream media in order to become successful
              • Exceptions - First Solar, although product has increase in efficiency, a byproduct was that the it "looks better" as electrodes are attached beneath rather than on top of the modules in order to increase efficiency
              • This is similar to Apple which used a sleek design in order to sell the product, meeting the social needs of the user
            • Similar story to Solyndra this means US companies require large initial investments, reduces amount of entrepreneurs capable of accessing the market
  • Energy Storage
    • There are two divergent paths a company can take
      • Invest into countries outside of the US
        • By taking control of third world countries there is a potential to have access to the infrastructure of an entire market over time
        • Can sell to a more mature market
      • Invest into a longer time span
        • assumes that the US will not tolerate other countries exceeding our infrastructure base
          • Has some merit i.e. average internet speed competition of Asian countries now being counteracted with Google fiber and other extreme high speed connections
          • Fiber slowly replacing copper

Sunday, November 3, 2013

Physics - Classical Theory of Conduction

The following is a brief overview of the classical theory of conduction.

Fluid Analogy
First I would like to invoke the fluid analogy to electricity. Basically there are many similarities between different phenomena for fluid mechanics and electronics. The reason why we have this analogy is simply that most people are used to dealing with fluids, especially those of us with access to plumbing and running water. However, most of us don't even think about electricity, we just put a plug in an outlet and stuff works.

Now how does a battery work? Its no mystery though Bill O'Reilly might disagree. We can see on a battery's label a + and a - sign. We can think of this as a lake at the top of a mountain and a lake on the bottom of the mountain. They have different potential energy due to gravity. When we plug in a battery its like digging a trench to connect the two lakes and putting a water mill in between it to drive our machine.

Relation to Conduction
We can then relate two other phenomena. Current in a wire is very similar to trying to get water to move through a pipe. The smaller our pipe, the less current can get through, which is similar to a wire with high resistivity. In electronics we can think of a wire as a lattice of of atoms. Our electrical current is then though of as electrons traveling through this lattice. An electrical field caused by our difference in potential drives electrons through this lattice but the lattice is stationary and stops/causes ricochets when an electron hits it. We can describe this with the following two equations:

I =ΔQ/Δt = neAvd and
λ = <v> τ =1/naπr2 as

Where for the first equation I is the current described by n the number of electrons, with charge e, passing through an area A with electron drift velocity vd. The second equation gives us λ is the mean free path, or the average distance a particle travels before a collision with <v> the average velocity multiplied against τ the average time between collisions. Through this we can figure out resistivity and conductivity and can derive Ohm's law. 

V = IR

Defects
This is a great approximation but there are significant errors when scaled to different temperatures and other quantum effects.

Paper - Skill Acquisition

Skill Acquisition as a Function of Effort

This is a discussion of my viewpoints on skill acquisition in relation to effort/time investment. First I'd like to divide skill into two main components, mechanics and execution mainly in relation to a sport or game, though this can applies to pretty much any skill when substituting in different terminology. Mechanics for a sport is the player's trained skills. For an athlete it would be the capability to move his/her body in a given precise way. An example for tennis would be for a player's forehand, the strength of the hit, its precision, timing of the shot after the bounce, etc. Execution is the player's capability to perform those mechanics under pressure, in competitive situations, or when something is "on the line".

Mechanics
Mechanics for a person will usually rise when effort is put in. So classically we can think of skill as a function of effort as something like this.


However, this as with everything has major pitfalls. It is very possible for this to go negative like so after some initial improvement. 


How does this happen?
Unfortunately it has everything to do with luck and our environment. When acquiring a skill everyone usually learns from somewhere. It usually builds upon something that is taught to us directly, or builds on past experiences that we are able to connect with the skill we want to improve. With the internet we can also be "self-taught" and do our own research but that information was still written by someone else in the first place. In some rare occasions people are pioneers and must figure out things the first time through, but we won't go into that too much here.

The issue with this is that our information source can be wrong. Whether it be a coach or a teacher, or some random article on the internet we might just be going about something the wrong way and be ingraining into ourselves incorrect muscle memory. We could also be guided by correct information but interpret it the wrong way which will have the same effect, worsening our skill.

Benefits?
The only thing we can really get out of this situation is experience. Usually by doing something for a long period of time, we can then make a realization on how to correct our errors, or observe or be observed by others and make the correction by fixing that information returning us to our original rate of improvement. However, there is a possibility of getting worse. This is a very important concept to understand, there is no fairness in the world, spending effort does not necessarily mean you will improve, but it does give you the chance to improve/change where you are.


Also not spending effort will always result in a decrease in skill over the course of a long period of time. Again things are not fair here, breaks can sometimes result in a breakthrough as you gain a new perspective. This phenomena is often talked about by academics, but it also applies to sports and other motor based skills as your muscles have an opportunity to loosen up on their habits/memory which can lead to greater control with additional information/accidental improvements. This means that a person's skill level is often riddled by positive and negative interjections like this, where mechanics raise and fall temporarily. Sometimes a person is able to grasp their sudden improvement and retain parts of it/all of it and increase their skill over a very rapid period of time, but it can also sink and again result in a decrease in mechanics if analyzed incorrectly.



Execution
Execution is essentially a person's mental game. Very few people have managed to obtain a stable mental game and it is affected by a wide range of events. A person's relationships, their confidence, their job, anything that causes mental stress or happiness outside of the pursuit of that skill can affect their ability to perform that skill. A graph that represents this would be something like the following.



This is the roller coaster ride of ups and downs that everyone experiences which is linked to our maturity. Speaking of which as we mature, we are able to clamp down on these variations, and improve based which can be represented with the following.


Basically as we mature we become more predictable and are able to reduce the impact of our emotions into our skills, thereby making our performance more reliant on our mechanics rather than state of our emotions. However this is one of the most difficult things to do, and honestly achieving this does not necessarily mean you will be the most successful, but I will discuss that at another time as it relates more to successful personalities, and less to the process of acquiring a skill.

Friday, November 1, 2013

Physics - Quantum Tunneling

The following is a brief overview of Quantum tunneling.

What is it?
Quantum Tunneling is the effect where a particle tunnels through a barrier it could not penetrate in classical physics.

Why does it happen?
Quantum physics tells us that matter exhibits both particle and wave-like behavior. Therefore if we apply this idea to an electron going up against an potential barrier, we can relate its behavior similarly to a more well known event, light traveling through a material such as glass. In this case, the brightness of the light passing through the surface is reduced and some is reflected back away from the observer behind the glass. With our electron, some of its probability function travels through the potential well, and some of it reflected, depending on the width of the energy barrier, which we can relate the opacity of an object.

Brief Overview of Formulation
The time independent Schrodinger equation is as follows

(-ħ2/2m)(d2Ψ(x)/dx2) + U(x)Ψ(x) = EΨ(x)

The full derivation will be done elsewhere but we can use these to get the solutions for traveling waves, which represents the probability function of a particle in motion. This represents our electron moving. Using the WKB approximation and a few other mathematical tricks such as series expansion, we arrive at the following equation for T the transmission coefficient or percentage chance at quantum tunneling.


The important part of this equations are, x1 and x2 which are the classical turning points for the energy barrier. We can therefore see that this equation depends primarily on two characteristics, the difference in energy between the particle/wave represented as E. V(x) which is the potential of the energy barrier given x, and the width of the barrier x where a higher energy difference results in a lower transmission coefficient, and a greater "width" again results in a lower transmission coefficient.

Relation to Electrical Engineering
This is a material science concept and when used in reference to tunneling in electrical components, we don't have to go into the full Feynman path integral method to just get an idea of how it works. We can get a good idea of the effects with the explanation above. Tunneling occurs with barriers the size of around 1-3 nanometers which will be extremely significant when dealing with finfets which promise to move the total size of the transistor to around the 10 nm range. Efforts must be made to maintain detection of the on and off state due to thermal noise and summation of inductance effects of nearby inductance effects. This means design rules must be made with greater spacing margins than might be otherwise done for normal mosfet design. 

Tuesday, October 29, 2013

Electrical Engineering - Finfet

The following will be notes taken on the subject of FinFets
  • Summary
    • Classical Mosfet
      • Transistor that operates by using an Electrical field to invert the channel allowing conduction from source to drain


        • The Classical Mosfet Dimensions
          • Include length the short distance in this picture, Width is the longer dimension
        • Functionality
          • Length reduction results in loss of control over the channel
            • performance reduction
      • Finfet
        • Goal
          • solve performance reduction caused by smaller sizes 
        • Wrap the gate electrode around the channel
        • Thin fin of sillicon acts as the channel and it is encased by the gate electrode
        • Silicon fin surrounded by extension implant and poly oxide
        • Premise
          • di-electric and metal gate allows for a stronger e-field to be formed as it increases the dimensions of the gate effective using the height/thickness of the fin as the channel length allowing for a decrease in overall size when compared to a typical Mosfet
        • Source and Drain can be wrapped in silicon germanium or silicon carbon stressors just like classical transistors
        • Shown below is a representation of a finfet design used for production
        • The gate electrode is uniform for ease of construction
    • Clarification of terminology
      • After seeing the design used for production, we can see that it is nearly identical to the construction of the tri-gate

      • The only difference is that a tri-gate includes multiple sources and drains whereas the finfet description shows only a single source and drain but the process of construction seems identical, and terminology could be used interchangeably assuming you're fine with annoying Intel
      • The original papers indicate that the original process of the finfet did not wrap around on top of the fin, lowering the overall z or height of the overall transistor but this is too complicated of a process for mass production so the standard finfet is equivalent to the tri-gate which does wrap around 
    • Benefits
      • Maintain performance which includes
        • Conductivity when turned on
        • Insulation when turned off
          • Finfet in relation to a standard mosfet reduces electron tunneling effect when insulation is small
            • Main issues are - weaker dielectric, small size
            • Finfet significantly increases volume of dielectric reducing leakage currents
        • increase switching speed
          • due to lower size due to gate capacitance being smaller
          • note - non-issue in modern constructions, interface delay between metals is more significant as we get to smaller scale
        • Lower's Voltage requirements
          • increases lifetime/efficiency of product per charge
      • Company Promises
        • estimation, 2-5% higher price in exchange for 37% speed increase and 90% reduction in leakage current
    • Complications
      •  Adds complexity to construction process
        • possible reduction in yield
          • can increase price significantly above 2-5% estimate for the company overall
      • Depending on process
        • high k-dielectrics are more expensive, but already required as transistor size decreases
      • Increased modeling difficulty
        • geomotries now are first order effects
          • random fluctuations in manufacturing can now cause deviations in result
          • impacts possible econcomic forecasts for the division
        • Verification
          • requires new software to ensure design rules for fin to fin spacing is followed
    • History
      • construction process has roots in 1990s

    Tuesday, October 22, 2013

    Notes - Square Roots Mod n

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Suppose we are told that x2 ≡ 71 (mod 77) has a solution
      • How do we find one solution/all solutions?
    • Proposition
      • if y has a square root mod p, then teh square roots of y mod p are +-x.
      • If y has no square root mod p, then -y has a square root mod p, and the square roots of -y are +-x
    • Example
      • Lets find the square roots of 5 mod 11. Since (P+1)/4 = 3, we compute x ≡ 53 ≡ 4 (mod 11). Since 42 ≡ 5 (mod 11), the square roots of 5 mod 11 are +-4 or 5,7 mod 11
      • Let's try to find the square root of 2 mod 11. Since (p+1)/4 = 3, we compute 23 ≡ 8 (mod 11). But 82 ≡ 9 ≡ -2 (mod 11), so we have found a square root of -2 rather than 2
    • Example
      • Composite Modulus square roots
      • x2 ≡ 71 (mod 77)
      • x2 ≡ 71 ≡ 1 (mod 7) and x2 ≡ 71 ≡ 5 (mod 11)
      • x ≡ +-1 (mod 7) and x ≡ +-4 (mod 11)
        • The chinese remainder theorem tells us that a congruence mod 7 and a congruence mod 11 can be recombined into a congruence mod 77
          • m1 = 7, m2 = 11, m = m1m= 77
          • M1 = m/m1= 11, M2 = m/m2= 7
          • M1N1 ≡ 1 (mod m1) => 11 N≡ 1 (mod 7) => 4 N≡ 1 (mod 7) => N≡ 2 (mod 7)
        • this will get us results of x ≡ +-15,+-29 (mod 77) 

    Tuesday, October 8, 2013

    Notes - Primitive Roots

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Consider the powers of 3 (mod 7)
      • 31≡ 3, 32≡ 2, 33≡ 6, 34≡ 4, 35≡ 5, 36≡ 1
      • Note that we obtain all nonzero congruence classes mod 7 as powers of 3
    • Generally when p is a prime, a primitive root mod p is a number whose powers yield every nonzero class mod p
    • Primitive Roots
      • Let g be a primitive root for the prime p
      • Let n be an integer. Then gn≡ 1 (mod p) if and only if n ≡ 0 (mod p - 1)
      • If j and k are integers, then g≡ g(mod p) if and only if j ≡ k (mod p - 1)

    Notes - Fermat's Little Theorem and Euler's Theorem

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Fermat's Little Theorem
      • if p is a prime and p does not divide a, then
      • p-1≡ (1 mod p)
      • Example
        • 210 = 1024 ≡ 1 (mod 11)
        • can then evaluate 253 (mod 11)
        • 253 = (210)523 ≡ 1523  ≡ 8 (mod 11)
    • We now require an analog for composite modulus n
      • Define φ(n) as the number of integers a between 1 and n such that gcd(a,n) = 1
      • Example
        • φ(10) = 4 [1,3,7,9]
      • Also can be deduced from chinese remainder theorem
        • φ(n) = n Πp|n (1-1/p)
      • φ(p) = p - 1 where p is a prime number
        • when n = pq where p and q are primes φ(pq) = (p - 1)(q - 1)
    • Euler's Theorem
      • If gcd(a,n) = 1, then aφ(n) ≡ 1 (mod n)
      • Example
        • What are the last 3 digits of 7803
          • same as working mod 1000
          • 1000 = 2353
          • φ(1000) = 1000(1-1/2)(1-1/5) = 400
      • Example
        • Compute 243210  (mod 101)
          • Note that 101 is prime, therefore 2100  ≡ 1 (mod 101)
          • Therefore (2100)432210 = 1432210 ≡ 1024 (mod 101) ≡ 14

    Notes - The Chinese Remainder Theorem

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Chinese remainder theorem is used to break a congruence mod n into a system of congruences mod factors of n
      • Example
        • Number satisfies x≡ 25(mod 42)
        • means we can write x = 25 + 42k (k is some integer)
        • we can rewrite 42 as 7*6
        • x = 25 + 7(6k)
        • x = 25 + 6(7k)
    • Chinese Remainder Theorem
      • suppose gcd(m,n) = 1. If an integer c is a multiple of both m and n, then c is a multiple of mn. given integers a and b there exists exactly one solution x (mod mn)to the simultaneous congruences
        • x ≡ a (mod m)
      • x ≡ a (mod m)
        • x ≡ b (mod n)
    • Lemma
      • Let m,n be integers with gcd(m,n) = 1
      • if an integer c is a multiple of both m and n, then c is a multiple of mn
    • Example
      • Solve x ≡ 3 (mod 7), x ≡ 5 (mod 15)
      • 7*15 = 105
      • list congruences
        • 5,20,35,50,65,80
        • 3,10,17,24,31,38,45,52,59,66,73,80
        • x ≡ 80 mod 105
      • solve
        • nk ≡ a - b (mod m)
        • k ≡ (a - b)i (mod m) [i is the multiplicative inverse of n]

    Wednesday, October 2, 2013

    Notes - Pseudo-random Bit Generation

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Ways to generate random bits
      • sampling thermal noise from semiconductor resistor
      • flipping coins
    • Sampling natural processes however is very slow and its difficult to ensure that the enemy does not view the process
    • Pseudo-Random generation
      • example rand()
        • takes a seed as an input produces output bitstream
        • based on linear congruential generators
        • xn = a x n-1 + b (mod m)
        • number x0 is the initial seed
      • this is suitable for experimental purposes but not for cryptographic purposes because it is too predictable
      • one way functions
        • functions f(x) that are easy to compute but is computationally infeasible to determine y = f(x)
        • therefore we can define a xj = f(s+j) for j = 1,2,3
        • DES, SHA
      • Blum-Blum Shub pseudo-random bit generator
        • quadratic residue generator
        • generate two large primes p, q that are congruent to 3 mod 4
        • then set n = pq and chose random integer x that is relatively prie to n
        • BBS produces a sequence by
          • x≡ x2j-1 (mod n)
          • bj is the least significant bit of xj
        • However BBS is slow to calculate due to size of primes

    Tuesday, October 1, 2013

    Notes - Block Cipher

    The following are notes from Introduction to Cryptography with Coding Theory.
    • also known as the hill cipher
    • choose an integer n, the key is an n x n matrix
      • M =
      • (1   2 3)
      • (4   5 6)
      • (11 9 8)
    • Message is written as a series of row vectors
      • abc becomes (0 1 2) which gets 
      • (012)(1   2 3)
      •         (4   5 6)
      •         (11 9 8)
      • mod 26
      • (0,23,22)
    • In order to decrypt we need the determinant of matrix M to satisfy
      • gcd(det(M),26)=1
      • Find the inverse of matrix M
      •       (-14 11 -3)
      • -1/3(34 -25  6)
      •       (-19 13 -3)
        • Since 17 is the inverse of -3 mod 26
      •      (22 5  1 )
      •      (6 17 24)
      •      (15 13 1)
        • can return plaintext by mulitplying inverse matrix by (0,23,22) mod 26
    • In order to perform the block cipher we just divide the plaintext into blocks of n characters and if the ciphertext does not divide evenly, the blanks are left as 0 but the matrix multiplication is still done
    • changing one letter changes n letters of plaintext therefore frequency decryption is very difficult
    • Claude Shannon
      • the fundamental foundations of cryptography include
        • Diffusion
          • means that changing one character of the plaintext, then several characters
        • Confusion
          • means that key does not relate in a simple way to the ciphertext
          • each ciphertext should depend on several parts of the key

    Saturday, September 28, 2013

    Notes - The Vigenere Cipher

    The following are notes from Introduction to Cryptography with Coding Theory.
    • A variation of the shift cipher
      • key for the encryption is a vector of a chosen length
      • Example
        • key length 6
        • (21,4,2,19,14,17)
        • corresponds to word vector
        • To encrypt we shift by the word vector
    • A known plain text attack will succeed if enough characters are known
    • Cryptanalysis uses the fact that english letter frequency is not equal
      • a - 0.082
      • b - 0.015
      • c - 0.028
      • d - 0.043
      • e - 0.127
      • f - 0.022
      • g - 0.020
      • h - 0.061
      • i - 0.070
      • j - 0.002
      • k - 0.008
      • l - 0.040
      • m - 0.024
      • n - 0.067
      • o - 0.075
      • p - 0.019
      • q - 0.001
      • r - 0.060
      • s - 0.063
      • t - 0.091
      • u - 0.028
      • v - 0.010
      • w - 0.023
      • x - 0.001
      • y - 0.020
      • z - 0.001
    • Variations can occur but usually takes effort to produce, example the book Gadsby does not contain the letter e
    • However, when using a Vigenere Cipher the frequencies are distributed so that the above is not nearly as useful in decryption
    • Finding Key Length
      • We find the key length by matching the number of coincidences
      • write the ciphertext, then rewrite it with a displacement
      • Example
      •     VVHQ
      • VVHQW
      • Then we mark each time there is a match between the two rows, and after trying multiple displacements the largest number of coincidences will be closest to the key length
    • Finding the Key: First Method
      • take a look at the 1+5n letters and find the frequency of letters then repeat for 2+5n, 3+5n, 4+5n, 5+5n we then guess at the code by finding the difference between the most frequent letter and e to find the overall shift that is used as the key
      • After finding the key we then test it by decrypting to confirm if the key was correct
    • Soft Proof
      • place the frequencies of the english letters into a vector A0 and let Ai represent the frequencies shifted by i
      • When taking the dot product of these two vectors we arrive at 0.066 with a full match but significantly less than that for any other shift
      • We can also use this knowledge to approximate the number of coincidences we should find for a given match, which would be 0.066*the number of comparisons

    Physics - Dielectrics

    This will be an introduction to dielectrics. Dielectrics are insulators that are mainly used to fill the gaps within capacitors in order to increase the capacitance it can hold. The Dielectric actually weakens the electric field within the capacitor as the electrodes induce a charge on the surfaces of the insulator, but this effect will never completely reverse the electric field.

    A Dielectric has a property called electric susceptibility which is designated by Χe. This is a multiplier of the electrical permittivity of free space ε0. This susceptibility is pretty much always an increase meaning its value is greater than one and can range up to 300 times larger depending on what you use as a dielectric. Therefore its effect on a capacitor can be thought of as simply changing the permittivity of free space to the permittivity of the material of the dielectric while keeping the rest of the equations that govern a capacitor the same.

    There are other phenomena to be examined but in general they correspond to the insertion or removal of a dielectric, which does not have many applications as they are mainly used to enhance capacitors.

    Back to ToC

    Physics - Series and Parallel Effects for Basic Electronic Parts

    This will be an overview for the effects of putting basic electronic components in series or parallel connections.
    • Series
      • Capacitors
        • Add as reciprocals 1/Ctot = 1/C1 + 1/C2 ...
      • Resistors
        • Add normally Rtot = R1 + R2 ...
      • Inductors
        • Add normally Ltot = L1 + L2 ...
    • Parallel
      • Capacitors
        • Add normally Ctot = C1 + C2...
      • Resistors
        • Add as reciprocals 1/Rtot = 1/R1 + 1/R2 ...
      • Inductors
        • Add as reciprocals 1/Ltot = 1/L1 + 1/L2 ...
    However there are additional rules with Inductors as the magnetic field of an inductor can affect nearby inductors. Also when there are only two things to add as reciprocals, can change the equation to Ctot = C1C2 /  C1 + C2

    Back to ToC

    Physics - Parallel Plate Capacitor

    This will be an introduction into the basic physics of a capacitor. A parallel plate capacitor is when we have two electrodes placed a distance d apart. One is charged Q and one is charged -Q which means that the capacitor doesn't have any net charge. Therefore with the exception of a small fringe field at the edges of the the capacitor we don't have a field when we view a capacitor from afar we don't see a net electric field.


    The electric field within the electric field is due to both plates. The field form the positive plate points away form the plate in this case to the right, and the electric field from the negative plate points towards the plate which is also the right. Therefore

    E = Q/ε0A

    This is an approximation for infinitely sized parallel plate capacitors but this is actually a good approximation for real world capacitors assuming d is much smaller than the size of the electrodes.

    Back to ToC

    Sunday, September 22, 2013

    Notes - Substitution Ciphers

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Shift and Affine ciphers are examples of substitution ciphers Vigenere and Hill Ciphers are not
    • Substitution Ciphers can be broken by a frequency count but how exactly does the process go?
      • Approximate Frequencies of letters in english
        • e - 0.127
        • t - 0.091
        • a - 0.082
        • o - 0.075
        • i - 0.070
        • n - 0.067
        • s - 0.063
        • h - 0.061
        • r - 0.060
      • With the exception of E the other letters are close enough that for a small sample we would not be able to decide which is which therefore we need to look at pairs of letters
        • e often contacts many low-frequency characters
        • a, i, o tend to avoid one other
        • n has around 80% chase to be preceded with vowels
        • h often appears before e and rarely after it
        • most common digram is th
        • r pairs more with vowels than s among the frequent letters
        • combination rn should appear more than nr
        • to is more common than ot
      • Proceeding applying these rules, it is necessary to decrypt the message through recognizing partial words within the text to figure out the key for low frequency letters

    New Developments - Peachy Printer

    What is additive manufacturing? Additive Manufacturing (AM) is 3D printing by stacking layers of shaped material on top of on another. These materials range from plastics, metals, concrete to maybe one day tissues. They take in information from 3D modeling software, and builds the image into an actual object. The current uses of additive manufacturing are as
    • a design tool
      • rapid prototyping
      • design visualization
    • to produce production parts in small quantities
    • as a hobby to produce knickknacks
    I've recently seen an interesting product that seems to lower the cost of entry to hobbyists called the peachy printer.
    http://www.kickstarter.com/projects/117421627/the-peachy-printer-the-first-100-3d-printer-and-sc
    Its a stereolithographic printer which means that it uses a laser to harden a resin into a solid. The idea behind it to drastically lower the cost of production is that it takes data from the audio output of a computer, runs it through a pic to change the position of a mirror to direct the laser to the correct positions, which lowers the cost to $100 or less!

    Its interesting to think about this and its relation to Globalization. Although it seems like everyone is big on expanded markets, buying products from around the globe, this brings things back more locally. If the accuracy of this technology can be improved on without an increase in cost, why would construction workers, for example those in home improvement buy things from stores when they could just print out the parts they need? This might grow to threaten the existence of businesses such as Home Depot, or other places that sell cheap furniture such as IKEA. Thoughts?

    Back to ToC

    New Developments ToC

    This is to keep track of new developments, specifically products or companies, I've noticed in different industries and musings about their impact on society.

    1. Additive Manufacturing
      1. Peachy Printer
    2. Electrical Engineering
      1. Finfet
    3. Sustainability
      1. Sustainable Energy - Storage Systems

    Saturday, September 21, 2013

    Notes - Affine Ciphers

    The following are notes from Introduction to Cryptography with Coding Theory.
    • This is a strengthened version of a shift cipher where x -> ax+B
      • example a = 9, B = 2
      • affine -> CVVWPM
    • Decryption involves reversing the cipher
      • y = 9 x + 2
      • In modular arithmetic we need to find the inverse differently than we would in algebra, more clearly described in Chapter 3
        • Since we are using the alphabet, we need to work with mod 26
        • therefore we need to find gcd(9,26) = 1
        • What we can do is use the extended euclidean algorithm to solve for a multiplier to 9 that would result 1 mod 26 aka
          • 9 x ≡ 1 (mod 26)
          • we can also see that multiplying 9 by 3 will also result in a remainder of 1 which satisfies this congruence
        • Therefore 3 is the desired inverse
      • x ≡ 3(y-2) ≡ 3y -6 ≡ 3y +20 (mod 26)
      • Example
        • map the letter V
        • V = 21
        • 3*21 +20
        • 81
        • 81 ≡ 5 mod(26)
        • the letter f
      • This decryption will allow us to return the plaintext of affine from CVVWPM
      • We must be able to find the inverse in modular arithmetic in order to have a usable key so arbitrary keys may result in multiple returns for a singular input
    • Possible Attacks
      • Ciphertext only
        • 312 keys only means its easy for a computer to break, however difficult by hand
      • Known Plaintext
        • knowing even some of the plaintext reduces the possibilities and can potentially result in breaking the code even without a computer
      • Chosen Plaintext
        •  if ab is chosen as plaintext we can immediately break the code
      • Chosen Ciphertext
        • again if AB is chosen as ciphertext we find the encryption key but we already have the decryption key in this case so no additional work is needed

    Friday, September 20, 2013

    Notes - Modular Exponentiation

    The following are notes from Introduction to Cryptography with Coding Theory.
    • We will often be looking at numbers in the form of
      •  xa(mod n)
    • suppose we want to compute 21234(mod 789)
      • start with 22 ≡ 4(mod 789) repeatedly square the sides
      • 2≡ 42 ≡ 16
      • 2≡ 162 ≡ 256
      • 216 ≡ 2562 ≡ 49
      • 232 ≡  34
      • 264 ≡  367
      • 2128 ≡  559
      • 2256 ≡  37
      • 2512 ≡  580
      • 21024 ≡  286
    • since 1234 = 1024 + 128 + 64 + 16 + 2
      • 21234 ≡ 286 * 559 * 367 * 49 * 4 ≡ 481 (mod 789)
      • never had to deal with number larger than 788^2

    Notes - Congruences

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Modular Arithmetic or Congruences
      • Let a, b, n be integers with n ≠ 0 
      • a ≡ b (mod n) 
        • read as a is congruent to b mod n if a-b is a mutliple of n
        • or congruent if a and b differ by a multiple of n
        • can be rewritten as a = b + nk for some integer k
      • Examples
        • 32 ≡ 7 mod 5
        • -12 ≡ 37 mod 7
    • Proposition
      • let a, b, c, n be integers with n ≠ 0
        • a ≡ 0 mod n if and only if n|a
        • a ≡ a mod n 
        • a ≡ b mod n
        • if a ≡ b and b ≡ c mod n, then a ≡ c mod n
    • Proposition
      • let a, b, c, d, n be integers with n ≠ 0 and suppose a ≡ b mod n and c ≡ d mod n
        • then a + c = b + d, a - c = b - d, ac ≡ bd mod n
    • Modulo operations
      • addition - we add them as integers then if the product is less than n we stop, if the product is larger than n-1 then we divide by n and take the remainder. 
      • subtraction - same as addition
      • multiplication- same as addition
      • note -  we can use negative but usually use positive integers
      • division
        • let a, b, c, d, n be integers with n ≠ 0 and with gcd(a,n)=1. If ab ≡ ac mod n then b ≡ c mod n. In other words, if a and n are relatively prime,we can divide both sides of the congruence by a
        • Examples
          • Solve 2x + 7 ≡ 3 mod 17
            • 2x ≡ -4
            • x ≡ -2 ≡ 15
            • division allowed because gcd(2,17) = 1
          • Solve 5x + 6 ≡ 13 mod 11
            • 5x ≡ 7
            • 7 ≡ 18 ≡ 29 ≡ 40
            • 5x ≡ 7 is equivalent to 5x ≡ 40
            • x ≡ 8 mod 11
    • Proposition
      • Suppose gcd(a,n) = 1. Let s and t be integers such that as + nt = 1. (They can be found via the extended euclidean algorithm) Then as = 1 mod n, so s is the multiplicative inverse for a mod n
      • Example
        • solve 11,111x ≡ 4 mod 12,345
        • gcd
          • 12,345 = 1 * 11,111 + 1,234
          • 11,111 = 9 * 1,234 + 5
          • 1234 = 246 * 5 + 4
          • 5 = 1 * 4 + 1
          • 4 = 4 * 1 + 0
        • Extended Euclidean Method
          • x0 = 0
          • x1 = 1
          • x2 = -1 * 1 + 0 = -1
          • x3 = -9 * -1 + 1 = 10
          • x4 = -246 * 10  + -1 = -2461
          • x5 = -1 * -2461  + 10 = 2471
        • Therefore
          • 11111 * 2471 + 12345 * y5 = 1
          • 11111 * 2471 ≡ 1 (mod 12345)
          • multiple original 11111x ≡ 4 by 2471 to get
          • x ≡ 9884 (mod 12345)
    • Summary
      • Finding a-1 (mod n)
        • use extended euclidean algorithm to find integers s and t such that as + nt = 1
        • a-1 ≡ s (mod n)
      • Solving ax ≡ c (mod n) when gcd(a,n) = 1
        • use the extended euclidean algorithm to find as + nt = 1
        • the solution is x ≡ cs (mod n)
      • What if gcd(a,n)>1?
        • If d does not divide b, there is no solution
        • assume d|b consider the new congruence
          • (a/d)x ≡ b/d (mod n/d)
          • solve above to obtain solution x0
          • the solutions of original congruence ax ≡ b (mod n)
            • x0, x+ (n/d), x+ 2(n/d),...., x0+(d-1)(n/d) mod n
        • Example
          • solve 12x ≡ 21 (mod 39)
            • gcd (12,39) =3
            • divide by 3
            • 4x ≡ 7 (mod 13)
              • we can get a x0 of 5 through trial and error or the extended euclidean method
              • we get two more solutions by adding 39/3 once then twice to obtain 18 and 31 as other answers.

    Thursday, September 12, 2013

    Notes - Solving AX+ BY = D

    The following are notes from Introduction to Cryptography with Coding Theory.
    • In a previous example we used the Euclidean Algorithm to find the GCD 
      • We will now show how we can get the integers x,y that fulfill
      • ax + by = gcd(a,b)
    • Example gcd(482,1180)
      • 1180 = 2 * 482 +216
      • 482 = 2 * 216 + 50
      • 216 = 4 * 50 + 16
      • 50 = 3 * 16 + 2
      • 16 = 8 * 2 + 0
      • Which gave us q1 = 2, q2 = 2, q3 = 4, q4 = 3, q5 = 8
    • We will now use the following sequences
      • x= 0, x= 1, x= -qj-1 xj-1 + xj-2
      • y= 1, y= 0, y= -qj-1 yj-1 + yj-2
    • In order to arrive at
      • x= 0
      • x= 1
      • x= -2 x+ x= -2
      • x= -2 x+ x= 5
      • x= -4 x+ x= -22
      • x= -3 x+ x= 71
    • y5 would be calculated similarly to arrive at -29
    • We would then plug this in to ax + by = gcd(a,b)
      • 482 * 71 + 1180 * (-29)
      • 2
    • This is often called the extended Euclidean algorithm
      • used for congruences

    Wednesday, September 11, 2013

    Notes - One-Time Pads

    The following are notes from Introduction to Cryptography with Coding Theory.
    • One-Time Pad is an unbreakable cryptosystem developed by Gilbert Vernam and Joseph Mauborgne 1918
    • Key is a random sequence of 0,1 same length as the message and are added together with XOR aka exclusive or
      • Example
        • plaintext  00101001
        • key         10101100
        • ciphertext 10000101
    • Decryption uses the same key, add teh key onto the ciphertext to return the plaintext
      • If used on the alphabet, the key is a random sequence of shifts between 0 to 25
      • unbreakable for ciphertext only attack
      • if we only have a piece of plaintext, the random generation means we know nothing about the rest of the key
      • Issues
        • truly random generation
        • trusted courier
        • key is very long, dangerous to reuse
    • Trivia
      • hotline between washington and USSR was thought to be a one-time pad
      • Variation of one time pad
        • satellite produce and broadcast several random sequences of bits at a rate fast enough that no computer can store more than a very small faction of the outputs
        • Alice wants to send message to bob
        • use RSA to agree on a method to sample bits from the random bit streams, use these bits to generate a key for a one time pad
        • Attacker Eve cannot decrypt because by the time she knows about the message the stream has disappeared

    Notes - Basic Notions

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Divisibility
      • let a and b be integers with a ≠ 0. a divides b if there is an integer k such that b = ak, or that b is a multiple of a. This is denoted by a|b
      • 3|15, -15|60
      • Proposition
        • for every a ≠ 0, a|0 and a|a. Also, 1|b for every b
        • if a|b and b|c, then a|c
        • if a|b and a|c then a|(sb + tc) for all integers s and t
    • Prime Numbers
      • A number p > 1 that is divisible by only 1 and itself is a prime number, any number that is not prime is called composite
      • Prime Number Theorem
        • Let π(x) ~ x/(ln x) where π(x) is the number of primes less than x in the sense that π(x)/x/(ln x) ->1 as x->
        • Example
          • 100 digit primes
          • π(10100) - π(1099) ~ 10100/(ln 10100) - 1099/(ln 1099) ~ 3.9 x 1097
      • Theorem - Every Positive Integer is a product of primes, and this factorization is unique up to a reordering of the factors
        • Lemma - If p is a prime and p divides a product of integers ab, then either p|a or p|b. More generally if a prime p divides a product ab...z then p must divide one of the factors a,b,...z
          • Therefore an integer can be written as the product of its prime factors to a given power
    • Greatest Common Divisor
      • GCD is the largest positive integer dividing both a and b
        • example gcd(6,4)=2; gcd(24,60)  = 12
      • Factor both numbers into primes, and take the smallest of the common divisors and multiply them together
      • Euclidean algorithm
        • Example gcd(482,1180)
          • 1180 = 2 * 482 +216
          • 482 = 2 * 216 + 50
          • 216 = 4 * 50 + 16
          • 50 = 3 * 16 + 2
          • 16 = 8 * 2 + 0
        • Since 2 was the last nonzero remainder, the gcd is 2
      • divide a by b in the form
        • a = q1 b + r1
        • if r = 0 then b divides a and the greatest common divisor is b if r ≠ 0 then continue with
        • b = q2 r1+ r2
        • rk-2= qk rk-1 + rk
        • rk-1= qk+1 rk 
        • gcd(a,b) = rk
      • Theorem - Let a and b be two integers with at least one of a,b nonzero, and let d = gcd(a,b). Then there exist integers x, y such that ax + by = d. In particular, if a and b are relatively prime, then there exist integers x,y with ax + by = 1.
      • Corollary - If p is a prime and p divides a product of integers ab,then either p|a or p|b. More generally if a prime p divides a product ab,...z then p must divide one of the factors a,b,...z

    Notes - Shift Ciphers

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Shift ciphers are one of the earliest cryptosystems and is attributed to Julius Caesar
      • gaul is divided into three parts
      • he then shifts each letter by 3 places
      • JDXOLVGLYLGHGLQWRWKUHHSDUWV
      • Encryption process is then x -> x + k where k = 3
    • Attackers methodology
      • Ciphertext only
        • If the method is known then there are only 26 possible keys. However there is most likely more than one meaningful message that can be found when using these keys.
        • Frequency analysis to see the shift, e is the most common letter in the English language, find the difference between the most common letter in the message and e
      • Known Plaintext
        • if you know one letter of plaintext the key is broken
      • Chosen Plaintext
        • again inputting even just one letter will give you the key
      • Chosen Ciphertext
        • seeing the output of an input will give you the key

    Notes - Classical Cryptosystems

    The following are notes from Introduction to Cryptography with Coding Theory.
    • For simple cryptosystems we can make a few conventions
      • plaintext is written in lowercase
      • CIPHERTEXT written in uppercase
      • Letters of the alphabet are assigned numbers from 0-25 starting from a
      • Spaces and punctuation are omitted

    Notes - Cryptographic Applications

    The following are notes from Introduction to Cryptography with Coding Theory.
    • 4 main objectives of Cryptography
      • Confidentiality
        • there should be no eavesdroppers to a message
      • Data Integrity
        • the messag should not be altered through transmission
        • hash functions to detect data manipulation
      • Authentication
        • Sender wants verification that message was received by the correct person
        • identification
      • Non-repudiation
        • cannot claim that a false message has been sent
    • Authentication is closely linked to non-repudiation but there are differences
      • In symmetric key encryption, Bob can be sure a message comes from Alice so authentication is automatic but cannot prove to anyone else that Alice sent that message since he could have sent that message himself
    • Functions
      • Digital Signatures
        • link an individual's identity to a message
      • Identification
        • password protection to identify oneself
        • Feige-Fiat-Shamir method of identification zero knowledge based method for proving identity without revealing password
      • Key Establishment
        • Various ways to pass keys
        • public key cryptography
        • Diffie-Hellman key exchange algorithm
        • Blom's key generation scheme and Kerberos
      • Secret Sharing
        • divide the key among different individuals so all members must be present to unlock
      • Security Protocols
        • How we carry out secure transactions
        • SSL, SET
      • Electronic Cash
        • Providing anonymity while catching counterfeiters
      • Games
        • How to determine fair randomness?

    Tuesday, September 10, 2013

    Notes - Secure Communications

    The following are notes from Introduction to Cryptography with Coding Theory.
    • Secure Communications
      • Actual message is called plaintext
      • Encryption methods are called keys
      • Ciphertext is the encrypted message
      • Goals of an attacker or eavesdropper
        • Read the message
        • Find the key and read all messages encrypted with that key
        • Corrupt initial message
        • Communicated with receiver of message masquerading as sender
    • Possible Attacks
      • Attacker has ciphertext only
      • Attacker has copy of ciphertext and plaintext
      • Attacker gains temporary access to encryption machine to create large quantities of ciphertext with known plaintext
      • Attacker gains temporary access to decryption machine to decrypt several strings of symbols
      • Kerckhoff's Principle
        • In assessing the security of a cryptosystem one should always assume the enemy knows the method being used
    • Symmetric and Public Key Algorithms
      • symmetric key
        • encryption and decryption keys are known to both sender and receiver
        • many cases encryption and decryption key is same
        • DES Data Encryption Standard AES Advanced Encryption Standard
        • Two types of ciphers
          • stream ciphers
            • data is fed in small bits, output in small bits
          • block ciphers
            • data is fed in blocks and fed into algorithm at once outputed at once
      • public key
        • introduced in 1970s
        • RSA encryption
        • Non-mathematical way to do public key encryption Receiver is Alice Sender is Bob
          • Bob sends Alice a box and an unlocked padlock
          • Alice puts message in box locks Bob's lock on it then sends the box back to Bob
            • authorization issues if first transmission is intercepted and lock is substituted
        • Computation of public keys are several orders of magnitude higher than symmetric keys
      • Codes - one to one usages Ciphers - encrypts every string of characters
    • Key Length
      • Brute Force attack -Try every single possible key to see which one yields meaningful decryptions
      • DES Algorithm has 56 bit key and thus 256 ~ 7.2x1016 keys
        • if you have a computer that can do 109 calculations a second would take about 3x1013 years to complete
        • Longer keys are advantageous but not necessarily more difficult to break
      • Other methods of attack
        • Frequency Analysis
        • BirthdayAttacks
      • One time pad is an unbreakable code
        • however requires a key as long as plaintext and the key can only be used once so is not practical

    Notes - Overview of Cryptography and its Applications

    The following are notes from Introduction to Cryptography with Coding Theory.

    • Cryptography is used to keep data secure
      • Increased need due to dependency on electronic systems
    • Cryptography is often used interchangeably with cryptology and cryptanalysis
      • Cryptology is technically study of communication over unsecured channels
      • Cryptography is designing systems to make channels secured
      • Cryptanalysis deals with breaking cryptographic systems
    • Coding Theory deals with representing input information symbols by output symbols called code symbols
      • often associated with error correcting codes

    Cyrptography ToC


    The following is a table of contents for Introduction to Cryptography with Coding Theory.
    1. Overview of Cryptography and its Applications
      1. Secure Communications
      2. Cryptographic Applications
    2. Classical Cryptosystems
      1. Shift Ciphers
      2. Affine Ciphers
      3. The Vigenère Cipher
      4. Substitution Ciphers
      5. Sherlock Holmes
      6. The playfair and ADFGX Ciphers
      7. Block Ciphers
      8. Binary Numbers and ASCII
      9. One-Time Pads
      10. Pseudo-Random Bit Generation
      11. LSFR Sequences
      12. Enigma
    3. Basic Number Theory
      1. Basic Notions
      2. Solving ax + by = d
      3. Congruences
      4. The Chinese Remainder Theorem
      5. Modular Exponentiation
      6. Fermat and Euler
      7. Primitive Roots
      8. Inverting Matrices Mod n
      9. Square Roots and Mod n
      10. Legendre and Jacobi Symbols
      11. Finite Fields
      12. Continued Fractions
    4. The Data Encryption Standard
    5. The Advanced Encryption Standard: Rijndael
    6. The RSA Algorithm
      1. The RSA Algorithm
      2. Attacks on the RSA
      3. Primality Testing
      4. Factoring
      5. The RSA Challenge
      6. An Application to Treaty Verification
      7. The Public Key Concept
    7. Discrete Logarithms
      1. Discrete Logarithms
      2. Computing Discrete Logs
      3. Bit Commitment
      4. Diffie-Hellman Key Exchange
      5. The ElGamal Public Key Cryptosystem
    8. Hash Functions
    9. Digital Signatures
    10. Security Protocols
    11. Digital Cash
    12. Secret Sharing Schemes
    13. Games
    14. Zero-Knowledge Techniques
      1. The Basic Setup
      2. The Feige-Fiat-Shamir Identification Scheme
    15. Information Theory
    16. Elliptic curves
      1. The Addition Law
      2. Elliptic Curves Mod p
      3. Factoring with Elliptic Curves
      4. Elliptic Curves in Characteristic 2
      5. Elliptic Curve Cryptosystems
      6. Identity-Based Encryption
    17. Lattice Methods
      1. Lattices
      2. Lattice Reduction
      3. An attack on RSA
      4. NTRU
    18. Error Correction Codes
    19. Quantum Techniques in Cryptography

    Monday, September 9, 2013

    Physics - Pulley Sample Problem

    What is the acceleration of the following configuration?

    Like with our atwood's machine example we solve this by looking at each mass individually. The forces acting on M are friction due to the table, opposing the tension T of the rope. The forces acting on m is the weight of m and the tension T of the rope. Now for atwood's situation we started with

    m1 g - T = m1 a
    T - m2 g =  m2 a

    and arrived at

    a = g(m1 - m2 )/(m1 + m2 )

    For this situation, we can see that m1 can be substituted with M as we define positive acceleration as M going left and m going up, and negative acceleration as M to the right and m going down matching the convention of gravity's downward acceleration. The only difference is that instead of m1 g being the force opposing T we have μMg which is the friction force due to the table. Making this substitution we arrive at


    a = g(μM - m )/(M + m )

    Physics - Atwood's Machine

    Atwood's Machine is a simple experiment that verifies the mechanical laws of motion under constant acceleration. As shown below two masses are attached to the ends of one pulley.


    If the weight of m1 and m2 are equal then there is no acceleration. However if they are unequal their acceleration would be as follows. We can define the forces acting on m1 as T the tension force of the rope and W1 the force due to the weight of the block. The forces acting on m2 are T the tension force and W2 the weight of the second block. As you can see the tension force has the same magnitude on each block and all that is left is to solve for our acceleration.

    m1 g - T = m1 a
    T - m2 g =  m2 a

    We then combine this system of equations by adding them together to get

    m1 g - m2 g = m1 a + m2 a

    This is the same as distributing g and a over m1 and m2 so our acceleration is

    a = g(m1 - m2 )/(m1 + m2 )

    Physics - Intro to Pulleys

    This will be an overview of pulleys and the assumptions that we make of them in mechanics. Usually when doing these problems we can
    • Ignore friction forces of the rope on the pulley itself
    • Ignore the mass of the pulley or rope
    Although these assumptions aren't necessarily true we can assume so if the weights are much larger in comparison to the weight of the pulley, or if there are multiple weights in the same system, that the difference between them is very large.

    What is the simplest way that we can see the advantages of using a pulley? In the following picture


    We can see a pulley attached to a ceiling moving a weight. The force the hand must exert is divided in two because the Tension force on the rope is evenly divided between rope being pulled by the hand and the portion attached to the ceiling reducing the effort of the person pulling the object up.

    Saturday, July 20, 2013

    Flip Flops and Memory

    Flip/Flops

    This is a simple flip/flop which acts as a latch. It operates through the use of feedback. Basically there are 4 scenarios. If you don't have a signal through either set or reset then whatever state the flip flop was in, it will stay in. If you input something into the reset but not the set the not Q will change. You can envision this as just a separate signal though through only the bottom wire. If you input into set but not reset, then the Q output will change, or the proper signal setting your "memory" bit to one. Which is why it can be called set. Then the Final is if you input a signal through both set and reset which clears all information, putting both states to 0.

    S R Q Q̅
    0 0 No change
    0 1 0 1
    1 0 1 0
    1 1 0 0




    This flip/flop is equivalent to one bit of memory as it is capable of holding a state.

    Binary, 2's complement, Hexadecimal-

    So since we are capable of storing a bit of memory, we can string them together to form larger sections of memory. We often refer to bytes of memory, which is 8 bits, which represents 256 different states.

    27 26 25 24 23 22 21 20
    0 1 0 0 1 1 0 1 would then = 77

    You can then partition the byte into two halves and write the number in hexadecimal 
    the high is
    0 1 0 0 = 4
    the low is
    1 1 0 1 = d
    Hexadecimal goes as 0 1 2 3 4 5 6 7 8 9 A B C D E F

    2's complement is a way of making the operations of addition multiplication and subtraction identical. If we had these 8 bits be positive only we would count through 256 possible numbers from 0-255. Using two's complement we go from 0 -> 127 and then go back down from -128 to -1.

    Boolean Operations

    Boolean operations are used to develop logical circuits. This will be a brief overview of these functions. We will establish a truth table, where 1 represents an on signal, 0 represents an off signal. Q is just the result of applying our function using the Boolean operation specified

    Q = A.B

    AND Gate
    The AND gate is an important function, we can think of this as multiplication as if we multiple the two signal together here we arrive at the following truth table for an AND gate.

    A B Q
    0 0 0
    0 1 0
    1 0 0
    1 1 1




    Q = Q̅ = A.B

    Function NAND
    This is the NAND gate or the not AND gate. This simply reverses all the outputs of our AND gate.

    A B Q
    0 0 1
    0 1 1
    1 0 1
    0 0 0



    Q = A + B

    Function OR
    The OR gate is similar to addition. However, its a version of addition that does not know how to carry over, as we can see by the last part of the truth table, but otherwise functions similarly.

    A B Q
    0 0 0
    0 1 1
    1 0 1
    1 1 1




    Q = Q̅ = A + B

    Function NOR
    Again like the NAND gate, the NOR gate simply reverses the signal of the OR gate.

    A B Q
    0 0 1
    0 1 0
    1 0 0
    1 1 0