My year in Facebook Statuses

It’s holiday season – it is that time of the year when you can take some days off work (yeah, right! ) and when you socialize with people(including distant relatives you forgot their first name but still salute warmly upon visit) and of course, in our modern days, it is that time of the year when you spend some time on facebook checking out what friends are up to. a “trending” app on my wall was “my year in facebook status”

so despite of all the important things i should be blogging about, here it is *drum roll* – a collage (?random selection/resume?) of my year in facebook statuses.

    1. Some girls like the shopping, some girls like to hear the hair dryer roaring…me i like sleeping, specially in my warm chamber, but here i am working, here i am the girl in a long boring meeting dum-a-doo dum-a-da-ada – (whiskey in the jar remix – Metallica )
    2. Ghandour since 1857 in the shi-tayeb making business – wow !
    3. Eish ya delicious, ma ti3milleh flickr bi3inek, ma 3am i2dar tal3ak min l <head> taba3eh
    4. Please copy and paste this if you or someone you love has been affected by someone who needs a punch in the face. People who need a punch in the face affect the lives of many. There is still no known cure for someone who needs a punch in the face, except a punch in the face. But we can help raise awareness. Thank you !
    5. Who said Facebook is media? Media contains blank spaces, Consumers weren’t trying to generate media. they were trying to talk to somebody, so it just seems a bit arrogant we hijack their own conversations, their own thoughts and feelings and try to monetize it.
    6. Quand ca doit merder, ca merde….et ca merde bi 2ouweh !
    7. is killing the bargash with a 1900 V electro-choc – It’s like a small tesla from red alert, super fun and finally having the chance to use it zzzztttt
    8. Quote of the day by Iman N. : If you want something you can either work for it OR put it on your amazon wish list and your friend will get it for you
    9. He who said google is your friend has obviously never met Aardvark
    10. Is wondering what china phone book looks like
    11. It is important to be open minded but don’t let your brain spill out
    12. I went to the gym today for the first time in a while – i swear i could hear my rusty bones 3am yzayz2o!
    13. Amazing fact that Rita Kamel pointed to me : in the old pre-light bulb days – in the huge castles of europe, candles had to be changed every 20 mins – imagine an army of servants changing those impressive mind-boggling chandeliers hanged on huge walls while there is a royal party for example and all this “without disturbing” – sucks to be a servant
    14. Jocy: the new fridge is nice – Me: Hein? – Jocy: we got a new fridge !!! Me: Hein ? when was that ?? this is new ??? Jocy: old one broke yesterday, this is new one, it is 2m long ! you didn’t notice the difference ? you come here everyday ! Me: staring at the fridge trying to figure out if it is new Jocy: staring at me – Me: *shrugs* hmm anyway, what’s on for dinner ?
    15. The best two situations for society is when we have complete privacy or complete non-privacy, it is the middle ground that is the problem

    (up next, my detailed horoscope prediction in 2011 – joking ! )

      Read More

      “presidency.gov.lb 77.42.252.18 has recently accessed your account”

      So it was 3 AM – i was logged into gmail for 3-4 hours and then the warning goes on.

      This rules out the possibility that my IP just got natted to theirs – so i logged out all sessions, changed passwords,etc

      But seriously? Leb Govt ? accessing ppl’s mail accounts while in their sleep ?

      I am wondering how much we need to re-think our online privacy as lebanese and actions to be taken.

      Please advise a next step.

      Read More

      Lebanese Govt. – FUCK YOU ! – Lebanese Internet users take another blow

      Yes a plain big FUCK YOU goes to the Lebanese Govt, Lebanese Telecom Minister and to each and every person in the decision making process in Telecom industry – min kill albeh – to every and each single one of you – FUCK YOU – even tho you don’t really need that since you are already fucking each other and on the way fucking up our life, careers and start-ups …

      The reason behind this rage : We are all aware that Lebanon has the 5th slowest internet on earth despite being located in the middle of this planet – we are not in some remote area where connectivity is hard, no we are in the middle of it ! yet our govt is failing  – yet again – to provide us with basic internet connectivity !

      Mada signs regional cable network agreement to transform telecom in Middle East

      Originating in Fujairah (United Arab Emirates) the 12.8 Terabits per second fiber optic cable will pass through Riyadh (Saudi Arabia), Amman (Jordan), Tartous (Syria) and will end in Istanbul (Turkey).

      Original link http://www.ameinfo.com/252143.html (take a minute to read it )

      Imagine it – it is going around us !

      So other than more and never ending frustration – just think about it ! Think of the unfair growing gap between Lebanon-Syria-Jordan-UAE-Turkey-KSA ! In an information age, this is litterally like people upgrading to Ferraris while we are still using only its logo aka horses/donkeys without even organized roads.

      It is not in the best interest of Syria and Jordan to sell us later – so by crippling lebanese tech sector, theirs is flourishing – and if they do sell us, they will sure sell at way higher prices – they will have control…. and this is the best case scenario.

      This whole infrastructur-ing thing and cabling is going to have effect for years to come – so seriously, honestly, deeply FUCK YOU – I am keeping an eye on any public appearance for those d**** – Will make sure they hear my opinion in person even if it gets me arrested.

      Read More

      [ Guest post by @yorgi_ ] Exploiting Weaknesses in RSA

      This is a guest post by @yorgi aka Georges Raad explaining Cryptography, history and security of RSA and featuring a code he wrote in C# to attack RSA. Enjoy the extra dose of geekry :)

      I’ve been recently working on one of the most interesting topics in my field and one of my favorite as well:
      Cryptography and Information Security…

      I – Introduction
      Cryptography is probably the most important aspect of communications security and is becoming increasingly important as a basic building block for computer security.

      By far the most important automated tool for network and communications security is encryption. Two forms of encryption are in common use:
      1- Conventional, or symmetric encryption.
      2- Public-key, or asymmetric encryption.

      The RSA algorithm was developed in 1977 by Ron Rivest, Adi Shamir, and Len Adleman at MIT and first published in 1978. The Rivest-Shamir-Adleman (RSA) scheme has since that time reigned supreme as the most widely accepted and implemented general-purpose approach to public-key encryption.

      II – Description of the Algorithm
      Note: (I used images to show operators, powers, and other mathematical terms that cannot be expressed here)

      Encryption and decryption are of the following form, for some plaintext block M and ciphertext block C:

      Both sender and receiver must know the value of n. The sender knows the value of e, and only the receiver knows the value of d. Thus, this is a public-key encryption algorithm.

      The ingredients of the RSA are the following:

      The private key consists of {d, n} and the public key consists of {e, n}. Suppose that user A has published its public key and that user B wishes to send the message M to A. Then B calculates C = M^e mod n and transmits C.
      On receipt of this ciphertext, user A decrypts by calculating M = C^d mod n.

      The resulting keys are public key PU = {7,187} and private key PR = {23,187}. The example shows the use of these keys for a plaintext input of M = 88. For encryption, we need to calculate C = 887 mod 187. This can be done by exploiting the properties of Modular Arithmetic.

      III – The Security of RSA
      Four possible approaches to attacking the RSA algorithm are as follows:

      1- Brute force: This involves trying all possible private keys.
      2- Mathematical attacks: There are several approaches, all equivalent in effort to factoring the product of two primes.
      3- Timing attacks: These depend on the running time of the decryption algorithm.
      4- Chosen ciphertext attacks: This type of attack exploits properties of the RSA algorithm.

      The defense against the brute-force approach is the same for RSA as for other cryptosystems, namely, use a large key space. Thus, the larger the number of bits in d, the better.
      However, because the calculations involved, both in key generation and in encryption/decryption, are complex, the larger the size of the key, the slower the system will run.

      We can identify three approaches to attacking RSA mathematically:

      1- Factor n into its two prime factors. This enables calculation of f(n) = (p 1) x (q 1), which, in turn, enables determination of d  e^-1 (mod f(n)).
      2- Determine f(n) directly, without first determining p and q. Again, this enables determination of d  e1 (mod f(n)).
      3- Determine d directly, without first determining f(n).

      Most discussions of the cryptanalysis of RSA have focused on the task of factoring n into its two prime factors. Determining f(n) given n is equivalent to factoring n.
      With presently known algorithms, determining d given e and n appears to be at least as time-consuming as the factoring problem. Hence, we can use factoring performance as a benchmark against which to evaluate the security of RSA.

      For a large n with large prime factors, factoring is a hard problem, but not as hard as it appears…

      IV – The Attack on RSA
      There are 3 known algorithms to attack RSA by factorizing N into 2 prime numbers,

      1- Quadratic Sieve (April 1991)
      2- General Number Field Sieve (April 1996)
      3- Lattice Sieve (April 2003)

      V – The Code
      What follows is a C# code i wrote today to factorize N into 2 prime numbers.

      long n = _N; // Get the value of N
      long sqrtOfN = (long)Math.Sqrt(n);  // Find the Square root of N.
      
      long p = 0;
      long q = 0;
      
      // Loop through all values untill reaching the Square Root
      // (There's no need to continue beyond this number)
      for (p = 2; p &lt;= sqrtOfN; p++)
      {
          // Check For Primality of P.
          if (_CheckIfPrime(p) == true)
          {
              // If P is prime, calculate q = N / P.
             // If Q must be a prime number too.
              q = n / p;
      
              // Check For Primality of Q.
              if (_CheckIfPrime(q) == true)
              {
                  if (q * p == n)
                  {
                      // Display Results...
                      MessageBox.Show(p.ToString() + "\n" + q.ToString());
                      break;
                  }
              }
          }
      }

      In order to check if a number is a prime, i wrote another function that returns the bool value True is the number checked is a prime.
      Here’s the function:

      public bool _CheckIfPrime(long number)
      {
          bool isPrimeNumberFound = true;
      
          // Get Square root of number and iterate
         // start from 2 (cannot start from 0 or 1).
          int checking = (int)Math.Sqrt((double)(number));
      
          // perform iteration from 2 all the way to the value of "checking".
          for (int j = 2; j &lt;= checking; j++)
          {
              // If remainder = 0 ==&gt; current number is not a prime number...
              if (number % j == 0)
              {
                  isPrimeNumberFound = false;
                  break;
              }
          }
          return isPrimeNumberFound;
      }

      Testing is code with values of N ranging between 0 and 2^32 gives instant results.
      for example, if N = 654643387, P and Q are equal to 25583 and 25589. (calculated instantly)

      Larger values takes some time to compute the 2 prime numbers P and Q.

      Note that for better security in the RSA, P and Q should be selected carefully. To avoid values of n that may be factored more easily, P and Q should differ in length by only few digits and should be on a close order of magnitude. The Closer to the Square root of N, the harder to guess P and Q.

      For example, if P = 11, which is a prime, it takes less than a fraction of a second to guess Q, since we’ll be checking values of P starting from 0 till the Square Root of N.

      ————-
      This is it for today, I hope you’ll like this post as much as i do. I tried to explain all keywords by adding references to Wkikipedia.

      I’d also appreciate any comments on this post.
      Cheers’ – @yorgi_

      Read More

      How twitter works

      The data in this post goes back to June 2009 aka almost 6 months

      I have been long amazed by twitter architecture as a coder – so i was digging around on technical details on how it works and the size of their infrastructure and such.

      I tweeted the links I found – now @vipwoody asked again if i still have the info – so i thought about sharing in post as a self-documentation and for the rest who could be interested.

      Reference 1 :

      Presentation of Evan Weaver, Lead Engineer in the Services Team at Twitter

      Improving Running Components at Twitter

      View more presentations from Evan Weaver.
      In case you are wondering – this is Evan -  cool dude :)
      • Most of the tools used by Twitter are open source.
      • Everything is kept in RAM and the database is just a backup.
      • The stack is made up of Rails for the front side, C, Scala and Java for the middle business layer, and MySQL for storing data
      • The front end mostly glues together several client services, many written in C: MySQL client, Memcached client, a JSON one, and others.
      • The middleware uses Memcached, Varnish for page caching, Kestrel, a MQ written in Scala, and a Comet server is in the works, also written in Scala and used for clients that want to track a large number of tweets.
      Here are also some pictures of the new Twitter offices : http://abduzeedo.com/new-twitter-office-headquarter
      Read More