Friday, February 25, 2011

Crypto codes: Pollard’s p − 1 factorization algorithm

Code here
It uses prime factor code from square root

Output shows the steps of the algorithm with results:
Find prime factors of 48356747:
2^19! -1 = 13944673 (mod 48356747)
gcd(2^19!-1,48356747) = 6917
factors of 48356747, p=6917, and q=48356747/6917=6991
The prime factorization of 6916 is: 2, 2, 7, 13, 19

The prime factorization of 6990 is: 2, 3, 5, 233

Thursday, February 24, 2011

Day `haven't-count-for-a-while:' Congratulations! You Won!

All the emails congratulate me, turn out to be spam.
I love you spammers, you keep me going.

Sunday, February 13, 2011

Monday, February 07, 2011

Crypto codes (3)

Download from here
For the inverse and fast squaring code, see Crypto codes: 1

Finds eth root modulo p:

public class RSA {

 //find x from x^e = c (mod p)
  public static long findRoot(long e, long c, long p)
  {
   long x = 0;
   
   //find e^-1 (mod p-1)
   long eInverse = crypto.inverse(p-1, e);
   
   //x = c^d (mod p)
   x = crypto.fastSq(p, c, eInverse);
   
   return x;
  }
       //test: answer = 6059
  public static void main(String[] args) {
   
      long e = 1583;
      long c = 4714;
      long p = 7919;
      
   long x = RSA.findRoot(e,c, p);
   System.out.println("Solution to x^"+e+" = "+c+" (mod "+p+"): x= "+x);
  }

}

This test will return:
Solution to x^1583 = 4714 (mod 7919): x= 6059

Matlab codes: http://www-users.math.umd.edu/~lcw/MatlabCode/

Wednesday, February 02, 2011

Crypto codes: Chinese remainder theorem

For gcd and inverse code, see Crypto codes

Java implementation of Chinese remainder theorem, download from here
Matlab code here

For this particular example, output will look like the following:

Step:0->x=2+3*5=17
Step:1->x=17+21*7=164
Solution:164

Sunday, January 23, 2011

Tuesday, January 04, 2011

Thursday, December 30, 2010

The bubbles are not reality but it's inside your mind



The bubbles are not reality but it's inside your mind, originally uploaded by sheetal_shundori.
We live in a bubble baby.
A bubble's not reality.
You gotta have a look outside.
Listen

Tuesday, December 21, 2010

Latex resume templates: http://www.rpi.edu/dept/arc/training/latex/resumes/

Girls Scout and my incoherent ramblings

Last month I attended the Girls Scout Saturdays event,  arranged by Drexel Ischool for introducing high school girls to Computer Science. I must say it was an amazing experience. When I was a high school student in Bangladesh, my school had an educational program where the high school students had to teach uneducated female garments factory workers. It was a highlight of my high school years. I love these sorts of events because I live in a tiny bubble of people who are like me, and mostly have the same educational/social background. These events give me a sneak peek of the rest of world which is completely different and remind me of a world, which I hardly think, exists. Also they remind me that I might seem really dumb in a world full of intellectuals but I am still useful to some other part of the world :-D.

Anyway, I was talking about my experience with the girls scout. I was invited to this event because I was once a software developer and I was supposed to talk about my experience. The event was for 6-12 graders. I had 12 graders in mind when I was preparing my presentation. But to my surprise, I saw that my audience was a group of 6-12 years "old" girls and I don't know how to talk software engineering with the people so tiny!  They all have facebook accounts and they use youtube, skype, emails. In someways, they know more about internet and games and softwares than I used to at that age, (I had my first computer at 20 and snails are faster than internet in Bangladesh). And the scary thing was that when I showed them a real site and a phishing site, no one could detect the fake site. They use internet everyday but they don't know the basic rules of security that why a webpage that looks real might not be real, why it's not good to download every attachment and click on every link in an email that is apparently coming from a friend and why it's not okay to click "Accept" every time your browser gives you a choice. These security decisions are hard even for the adults! How it is possible to make them understandable for these kids? Now I think I understand what Ross Anderson was saying about security and usability that most systems are not designed to consider all kinds of users. Just imagine that you let your kid (or your old parents or anyone) to check emails using your laptop and she downloads every attachments her friend sends and thus installs trozans and keyloggers on your laptop that you use to check your bank accounts. All that encryption and SSL on your bank site won't save your credentials to become a product in the hackers' market. One weak link in the security-chain completely breaks the whole system.

In these days everything I see or read or do or think, brings back this insecurity complex. On another note, the outside world just seems to be getting too interesting to disregard.

Sunday, December 12, 2010

Security research is making me skeptical and paranoid about everything. Is that a good thing or bad?

--
[Update] Yes, I do think it is a good thing because it makes me question about the security concerns of the seemingly innocuous choices we make everyday, like giving my email address to win an ipad or installing a browser extension "for a cause" that would donate for every tab I open and also will track my browsing behavior for targeted advertisements (which they do anyway though) or giving an "anonymous" handwritten review which is "obviously" anonymous just because it doesn't have my name on it! There is this fine line between being paranoid and being precautious, of which I am kind of aware of but do not understand, yet, where the line lies.

Tuesday, November 30, 2010

Today is the day


, originally uploaded by sheetal_shundori.

Today is the day to be Happy
Today is the day to be Free
Today is the day that will change everything