Dot Name

Thursday, April 09th, 2009 7:09pm by Ryan Lewis

I had some trouble with my domain recently where it was pointing to a parked page. This was because my hosting provider didn’t update my registration in time, but this has all been resolved now.

This dilemma got me thinking and I decided to purchase a dot name domain. ryan.lewis.name now points here!

Fix “Unexpected clusters per mft record (-127)”

Sunday, March 15th, 2009 12:44pm by Ryan Lewis

I encountered this error yesterday after trying to fix some Windows bootloader issues in Ubuntu with ms-sys. Needless to say, I just created more issues and eventually couldn’t even mount my Windows partition from Ubuntu, as this would happen:

# mount -t ntfs-3g -o force /dev/sda1 /mnt/win
Unexpected clusters per mft record (-127).
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't have a valid NTFS.

I tried to recover it using a Windows XP disk, but that didn’t work because it wouldn’t recognize my C:\WINDOWS folder! At this point, I was getting pretty worried.

So, back in Ubuntu, I do a bit more reading and find out about the testdisk command (apt-get install testdisk) and a nice post about how to use it on the Ubuntu forums. To summarize, this is what I took out of that post to get mount to actually work after:

After starting testdisk, choose “No log”, choose the correct HDD and “Proceed”, choose “Intel”, choose “Advanced”, select the Windows partition, choose “Boot”, then choose “Rebuild BS”.

If testdisk gives you a warning that the “Extrapolated boot sector and current boot sector are different”, then choose “Write”.

Sure enough, something was messed and it was able to fix it after I selected “Write”.

After all this, mount worked, and when I rebooted, the Windows XP disk detected the installation and I was able to fix my MBR like I wanted.

Zero-Knowledge and You: A Beginner’s Guide to SPHiNX & Challenge-Response Protocols

Thursday, January 29th, 2009 8:27pm by Ryan Lewis

This is a paper that Josh Hollenbeck, Pat Wilbur, and myself wrote last semester for Cryptography. Just posting it for anyone who wants to read it.

We present a method for zero-knowledge, hash-based challenge-response network authentication in lieu of transmitting a password across the network. Zero-knowledge protocols, like our method, offer authentication alternatives to prevent a third-party from discovering a password after intercepting network data. Our method makes use of one-way hash functions to generate a response from a randomly-created challenge code supplied by an identity verifier. Our method also makes use of dynamic engagement for choosing which hash functions are used on a per-case basis, in order to thwart reversal of our method in the event of future discovery of weaknesses in any of the deployed hash functions.

Zero-Knowledge and You: A Beginner’s Guide to SPHiNX & Challenge-Response Protocols (PDF)

Webpage running SPHiNX

Random Numbers and NTL

Thursday, December 04th, 2008 9:36pm by Ryan Lewis

According to its website, the Number Theory Library (NTL) is a:

high-performance, portable C++ library providing data structures and algorithms for manipulating signed, arbitrary length integers, and for vectors, matrices, and polynomials over the integers and over finite fields.

I have been using it a lot because of the Cryptography class that I’m in this semester, and something that I need to do frequently is generate random numbers.

To do this, seeding is frequently required, and the NTL is no different, but it took a while for me to actually get it to work. The following will seed the random functions provided by the NTL ZZ class:

ZZ number, seed;
srand(getpid());
seed << ((long) GetTime() ^ rand());
SetSeed(seed);
RandomLen(number, rand() % 300);

Stick that at the top of your main() and you should be all set.

Also, does anyone know of a shorter, possibly easier to remember, way to do this? If so, the comments are open.