Updates from September, 2008 Toggle Comment Threads | Keyboard Shortcuts

  • CG 7:09 pm on September 30, 2008 Permalink | Reply

    Happy Eid! 

    Happy Eid, everybody (who celebrating Eid) !

    The coding will still be in progress while celebrating Eid at the hospital 😉

  • CG 4:16 am on September 30, 2008 Permalink | Reply

    Add more points! 

    Referring to previous posting, for limited number of characters can be represented by big number, I’m thinking about dividing messages and convert them into different points in the elliptic curve.

    But next question will be: how to reconstruct the message from the points?

  • CG 11:33 pm on September 29, 2008 Permalink | Reply

    Bigger NUMBITS? 

    Is it as simple as increasing the NUMBITS to get more space for data?

  • CG 8:59 pm on September 29, 2008 Permalink | Reply
    Tags: ,   

    How big? 

    After thinking for a while, what is the maximum big integer needed to represent a stream of characters? I mean, if I convert characters into a big number like I did in the previous posting, then I can only have 42 characters at maximum! O-ow, big problem!

    Have got to find another way  [thinking hard…]

    • Budi Rahardjo 3:52 am on September 30, 2008 Permalink | Reply

      You can treat stream of characters as block of characters (say block of 42 characters). Then you can do the rest with your code.

      But I think there’s a better way to represent string (i.e. not just concatenate the ASCII values). Can you view them as series of bytes? This way, you can also code binary data (i.e. sequence of bytes) into big int. I am not sure whether this is efficient or not. though.

      Sorry if I am not clear. Hey, this is early in the morning and I am not awake yet. 🙂

    • chikaradirghsa 4:21 am on September 30, 2008 Permalink | Reply

      @BR: yes, exactly. it’s early in the morning and we’re still awake talking about representing characters! 😀

      agree, before reading your comment I have been thinking about dividing messages into message blocks and convert them into different points in the curve.

      i don’t understand the second paragraph. i’m treating the string as the series of bytes. explain please

    • Budi Rahardjo 9:15 am on September 30, 2008 Permalink | Reply

      In your example, CRYPTO, you convert it into a string “678289808479″. What if you convert that into sequence of bytes: 67, 82, 89, 80, 84, 74. Thus, just put them in the LSB in that order (or whatever order you choose). This way, 6 characters are turned into 6 bytes. But, you still have limitation (the number of bytes in big int). Anyway, it’s just an idea.

      The nicest thing about this is that you can read a binary file and read it into chunk of bytes. You are not limited to ASCII representation of the bytes.

      Again, I’ve seen a more efficient implementation. Basically, you want to put more bytes into the block/chunk. (Maybe base-64 or some sort? I have to read up on this. I am rusted!)

      Is it clear? Or more confusing? 😀

    • chikaradirghsa 6:55 pm on September 30, 2008 Permalink | Reply

      @BR: i have read about some string encoding/decoding like MIME base64, and I also found piece of code on that in CryptoLib, but they all just give me more headache 🙂

      i think for now i will just use the conversion in string of numbers, and do the complete cycle of encryption/decryption. then i’ll experiment with more text which will be converted to more than one points.
      then we’ll think about more efficient way to do that afterwards 😉

      how about that?

  • CG 8:28 pm on September 29, 2008 Permalink | Reply
    Tags: , , ,   

    Characters to numbers 

    I’m experimenting with the way of converting a string into a big integer representation. And this is how I’m doing it:

    1. Convert each character to its ASCII number, then treat them as a sequence of numbers that becomes a big number. For example, if the text is “CRYPTO” then the number will be “678289808479”. This number then will be stored in a FIELD2N variable. [done]
    2. The number then calculated to check if it fits on the curve. If not, add 1 to the next byte outside the bytes used for storing data. Repeat until the value fits in. [to be done next]

    Here’s some result:

  • CG 1:44 am on September 29, 2008 Permalink | Reply
    Tags: ,   

    Math Polynomial 

    Move forward to Galois Field representation in C. Zooming in all the modules of math for polynomial representation with the prime number 2 as the modulus (means that the coefficient and only take values of 0 or 1).

    The text converting code is halfway to go.

    • yuti 9:53 pm on January 1, 2009 Permalink | Reply

      Aaaaaa…. selalu pengen belajar Galois, waktu itu pernah mau belajar tentang Galois waktu sedang seneng baca tentang ehmm…mmm… kayanya tentang social network dan transformasi-transformasi gitu… aaaaaa… cerita-cerita

    • CG 4:44 am on January 2, 2009 Permalink | Reply

      yuti: hah, gue sampe skarang juga belum ngerti2x yut 😀

  • CG 12:52 am on September 28, 2008 Permalink | Reply

    Big integer representation : done! 

    Next : executing text to point conversion.

    Let’s say we have 13 bytes of bit stream, characters, binary picture data, etc, put it into the lowest 13 bytes of FIELD2N variable and see if the value fits on the curve. If not, add 1 to byte 14. Check again if the x value not fits on the curve. We just keep adding one and check until find a value that does fit on the curve.

    Then pick one of 2 y values associated with x.

    Sounds very simple. But let’s see how to deal with it tomorrow.

    Now is very late and I’m going to zzzzzz…….

  • CG 8:23 pm on September 27, 2008 Permalink | Reply
    Tags: ,   

    Converting ASCII to BIGINT and vice versa 

    Reporting a little progress today, that I have successfully understood and made a code to convert ascii to bigint and vice versa.

    The structure for a big integer is as follows:

    typedef unsigned long ELEMENT;
    typedef struct {
        ELEMENT        hw[4*MAXLONG];
    }  BIGINT;

    MAXLONG is the number of machine words used in an array that holds NUMBITS. NUMBITS is the total number of bits we expect to be working with.

    I’m still using Rosing’s book for reference.

    Next step will be make more codes on big integer’s operations.

    Then what? Why am I doing this anyway?

    […recalling the last progress…]

    Oh – oh, I guess I was in the middle of trying to find a way on how to convert a big number into a point in elliptic curve… and then, I need to know how to represent a big big integer, and how to deal with it.


    I guess it will be easier to continue working on the plaintext converting code.

    Ok, that’s it for now!

    • Budi Rahardjo 7:35 am on September 28, 2008 Permalink | Reply

      Trying to understand. Does big integer needed in elliptic curve? Meaning, everything is done in bigint. Is that it?

      How do you convert ASCII to bigint? Do you simply put the ASCII value in the LSB of the bigint? Can you extend that to unicode representation?

    • chikaradirghsa 6:53 pm on September 28, 2008 Permalink | Reply

      @BR: yes, big integer is needed in elliptic curve because the data and the point and the curve will be in big integer representation.

      the ASCII is treated as string, then converted to big integer. Ex: “12345” will be converted into 0x3039 and then (as you said) put in the LSB of the bigint.

      Do you think unicode representation will be much easier?

    • tetangga sebelah 7:36 pm on October 6, 2008 Permalink | Reply

      gila saking begonya saya…sampai egak tahu, kenapa ASCII ke Big-Integer jadi masalah.
      bukannya ASCII atau unicode itu integer?…..jadi itu kan hanya process widening.
      …..wah kayanya ini batas aku bisa nyuri ilmu……teu kataekan ahhhh

    • chikaradirghsa 8:50 pm on October 6, 2008 Permalink | Reply

      @tetangga sebelah: jelasin atuh process widening!

    • musloyals 7:49 pm on October 21, 2008 Permalink | Reply

  • CG 10:11 pm on September 25, 2008 Permalink | Reply
    Tags: debugging, ,   

    Back to XCode 

    Back to XCode, back to crypto debugging/programming, back to Rosing.

    Still cannot decide which one is better, CodeBlocks or XCode, and I don’t need to 😉  I feel comfortable with both, so I use CodeBlocks for teaching and non-crypto programming, while I use XCode for crypto programming.

    So far XCode gives more details in debugging. And CodeBlocks gives me clearer codes to understand. I’ll stay away from the library for some times now.

    • Budi Rahardjo 7:25 am on September 28, 2008 Permalink | Reply

      In terms of memory usage, is CodeBlocks more efficient than XCode? (Or the other way around?)

      My iBook has a limited memory 😦
      I have both Xcode dan Codeblocks installed, but I’ve never used Xcode seriously. Trying to clean up my mac. Thinking of removing Xcode.

    • chikaradirghsa 7:11 pm on September 28, 2008 Permalink | Reply

      @BR: so far i haven’t found any references on comparing memory usage of CodeBlocks and XCode.
      but this link is quite useful. Both CodeBlocks and XCode have debugger, GUI builder and toolchain, except XCode doesn’t not run on Windows and Linux 😉

      Since you’re bragging about PERL all the time, I think you won’t need XCode on your mac 😛

  • CG 11:46 pm on September 24, 2008 Permalink | Reply

    Library headache 

    It’s true that I haven’t spend much of my time for doing my phd research for more than a month now, but I keep trying to keep in track on what I’ve been doing, and hoping to make some tiny little lil progress.

    I’ve been exploring a crypto library and also read the manual, and got some help from a friend, and still, I got the headache and decided to re-read Michael Rosing’s.

    That’s all I’ve got for now.

    • – – s i g h – – –
    • tetangga sebelah 10:40 pm on September 25, 2008 Permalink | Reply

      wah kasian belum ada yang komentar….komentar ahhh
      bu met lebaran….salam buat semua……dan semoga…..Allah selalu with you and every one you love.
      dah sekarang jangan mikirin yang susah2 dulu……even bu chika needs a rest and makan ketupat……biar lebih mudah bersyukur…….

    • chikaradirghsa 8:35 pm on September 27, 2008 Permalink | Reply

      @tetangga sebelah: hey hey, makasih yaaaa. selamat lebaran juga, jangan lama2x uy mudiknya, bantuin gua coding uy 😉
      lebaran ini kayaknya ga ada ketupat uy! adanya makanan di rumah sakit 😀

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc