I watch the stars from my window sill
The whole world is moving, and I'm standing still
I almost wish I hadn't gone down that rabbit-hole — and yet — and yet — it's rather curious, you know, this sort of life!
Sunday, August 07, 2011
Sunday, July 24, 2011
Thursday, May 05, 2011
"Would you tell me, please, which way I ought to go from here?"
"That depends a good deal on where you want to get to," said the Cat.
"I don’t much care where--" said Alice.
"Then it doesn’t matter which way you go," said the Cat.
"--so long as I get SOMEWHERE," Alice added as an explanation.
"Oh, you’re sure to do that," said the Cat, "if you only walk long enough."
"That depends a good deal on where you want to get to," said the Cat.
"I don’t much care where--" said Alice.
"Then it doesn’t matter which way you go," said the Cat.
"--so long as I get SOMEWHERE," Alice added as an explanation.
"Oh, you’re sure to do that," said the Cat, "if you only walk long enough."
Wednesday, May 04, 2011
I couldn't open file name `*.aux'
If you have more than one bib file, add them like this:
\bibliography{bibliography_1,bibliography_2,bibliography_3}
Open up the .tex file and compile it using Latex (Shift+Apple+L) then compile it using Bibtex (Shift+Apple+B)
\bibliography{bibliography_1,bibliography_2,bibliography_3}
Open up the .tex file and compile it using Latex (Shift+Apple+L) then compile it using Bibtex (Shift+Apple+B)
Monday, May 02, 2011
Gender Guesser
Gender Guesser Script: http://www.hackerfactor.com/GenderGuesser.php
This script can guess gender from writing sample.
It's not 100% accurate but it predicted me as a female!!
It's so weird that how much information we reveal about ourselves without even thinking about it.
This script can guess gender from writing sample.
It's not 100% accurate but it predicted me as a female!!
It's so weird that how much information we reveal about ourselves without even thinking about it.
Thursday, April 28, 2011
Project Implicit
Project Implicit (https://implicit.harvard.edu/implicit/) is about our conscious and unconscious preferences and biases. For example, most people connote blondes with "dumbness", and tall and handsome with "intelligence"; we don't do it consciously, or we don't want other people to know about our true biases. But even when we try to hide our preferences, we end up revealing them through our attitudes or actions.
The Implicit project tries to measure these unconscious biases. In the test you have to categorize words into different groups, generally two. For example, the gender-science test will ask you to categorize different words into two groups: male/science and female/arts. Then it will ask to categorize words into other two groups: female/science and male/arts. If you are biased about man and science, then you'll take more time to classify science words as female/science than to classify them as male/science. The test will measure your response time and figure out your true preference.
I read about this project in "Blink." Then I took several tests and got very weird results. Like, I don't have any preference for female and science over male and science. But my test suggested that I do. I took another test about preferring self over others, whose result was contradictory as well. I feeling a little confused about myself now.
But it was fun!
The Implicit project tries to measure these unconscious biases. In the test you have to categorize words into different groups, generally two. For example, the gender-science test will ask you to categorize different words into two groups: male/science and female/arts. Then it will ask to categorize words into other two groups: female/science and male/arts. If you are biased about man and science, then you'll take more time to classify science words as female/science than to classify them as male/science. The test will measure your response time and figure out your true preference.
I read about this project in "Blink." Then I took several tests and got very weird results. Like, I don't have any preference for female and science over male and science. But my test suggested that I do. I took another test about preferring self over others, whose result was contradictory as well. I feeling a little confused about myself now.
But it was fun!
Wednesday, March 23, 2011
Saturday, March 12, 2011
Crypto codes: GGH public key cryptosystem
Download code from here
I only did the decryption part, using Babai's algorithm (for homework :D)
I only did the decryption part, using Babai's algorithm (for homework :D)
Friday, March 11, 2011
Crypto codes: Elliptic ElGamal
Download code from here
Crypto codes:Miller Rabin Primality test
Download code from here
Output: (exercise 3.14 in the Introduction of Mathematical Cryptography)
Output: (exercise 3.14 in the Introduction of Mathematical Cryptography)
1105 is composite with witness 2 294409 is composite with witness 2 118901509 is prime 118901521 is composite with witness 2 118901527 is prime 118915387 is composite with witness 2
Crypto codes: Elliptic curve cryptography
Download code from here
Code includes:
Elliptic curve addition,
Point in Elliptic curve over finite fields
double-and-add algorithm for Elliptic curves
Output:
Code includes:
Elliptic curve addition,
Point in Elliptic curve over finite fields
double-and-add algorithm for Elliptic curves
Output:
Points in E(F13) are : (-Infinity,-Infinity) (1.0,5.0) (1.0,8.0) (2.0,3.0) (2.0,10.0) (9.0,6.0) (9.0,7.0) (12.0,2.0) (12.0,11.0) Addition test-> (9.0,7.0) + (1.0,8.0) =(2.0,10.0) double-and-add algorithm for elliptic curve-> 947*(6.0,730.0) mod 3623= (3492.0,60.0)
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:
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.
I love you spammers, you keep me going.
Sunday, February 13, 2011
Crypto codes: Square roots modulo composite moduli
Chinese remainder code: Here
Fast squaring code: Crypto codes 1
Square roots modulo composite moduli: Download from here
Fast squaring code: Crypto codes 1
Square roots modulo composite moduli: Download from here
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:
This test will return:
Matlab codes: http://www-users.math.umd.edu/~lcw/MatlabCode/
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:
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
Crypto codes: ElGamal public key cryptosystem
Algorithms from An Introduction to Mathematical Cryptography book.
Here, Bob sends an encrypted message to Alice using ElGamal public key cryptosystem.
Download code from here
Extended Euclidean algorithm
Matlab code for modular inverse:
Here, Bob sends an encrypted message to Alice using ElGamal public key cryptosystem.
Download code from here
Extended Euclidean algorithm
Matlab code for modular inverse:
[u,y,d] = gcd(x,p); y = mod(y,p);
Subscribe to:
Posts (Atom)