Updates from April, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • CG 9:55 am on April 30, 2010 Permalink | Reply
    Tags: , ,   

    Encryption – Decryption finally works 

    With the help of this debugger and that debugger, changing the data from this:

    into this:

    make the code works. It’s because the data occupied more space than the capacity of the number of words.


    lss-67-39:Rosing Experiments CG chika$ ./test_elgamal_CG
    poly_prime =
    8 0 0 0 0 c9
    setting up curve

    the curve after setting up:
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    counter = 0
    inc = 5
    Base point
    x: 5 63323eab 10fc68f8 254d4d11 d2d518f2 9979dd24
    y: 4 883e6269 de8bf93e f6c224e3 330dbf7f 2dd25ec1

    create side 2's private key

    Side 2 secret:
    5 5d0be8bb a913fcdb 91edee60 4da6d486 295d85ac

    Generate side 2's public key

    Side 2 public key
    x: 0 60838c40 7580aec4 b658d152 729f7f67 51d694bd
    y: 0 1be3f90c c4a81de1 848ff01b d63e97a4 6b46c459
    data =
    0 68616c6c 6f0a0000 0 0 60000000

    Hide data on curve and send from side 1 to side 2

    curve before send_elgamal:
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    Their_public before send_elgamal:
    x: 0 60838c40 7580aec4 b658d152 729f7f67 51d694bd
    y: 0 1be3f90c c4a81de1 848ff01b d63e97a4 6b46c459
    =====IN send_elgamal=====
    data (in send_gamal function) :
    0 68616c6c 6f0a0000 0 0 60000000
    Base point
    x: 5 63323eab 10fc68f8 254d4d11 d2d518f2 9979dd24
    y: 4 883e6269 de8bf93e f6c224e3 330dbf7f 2dd25ec1
    Base curve
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    random value:
    5 3a0f94f6 e0caf9a7 2d189f04 8591c5e5 3935d4dc
    Random point C1
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6
    counter = 0
    inc = 0
    raw point M (after poly_embed)
    x: 0 68616c6c 6f0a0000 0 0 60000000
    y: 0 7a64a103 a296a42d 4130d375 23ef2cf2 3f1a3ec0
    Their_public:
    x: 0 60838c40 7580aec4 b658d152 729f7f67 51d694bd
    y: 0 1be3f90c c4a81de1 848ff01b d63e97a4 6b46c459
    hidden point (after poly_elptic_mul)
    x: 7 1f5fceb7 8269106c c1708600 cde8821b 38e0c7ee
    y: 2 d752fec4 40840001 be4a3e7f 347e7013 7f36ce97
    Hidden data (C2):
    x: 6 a8a348b9 60a911b7 852a3bb9 8ba949df 5a157ae
    y: 0 239b098 7584aea3 af4431db 2f3fa3f4 312c5ea9
    Random point (C1):
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6
    =====OUT send_elgamal

    AFTER send_elgamal
    curve after send_elgamal:
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    Hidden data (C2)
    x: 6 a8a348b9 60a911b7 852a3bb9 8ba949df 5a157ae
    y: 0 239b098 7584aea3 af4431db 2f3fa3f4 312c5ea9
    Random point (C1)
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6

    Recover transmitted message

    IN receive_elgamal
    Base curve in receive_elgamal
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    Hidden_data (in receive_elgamal) :
    x: 6 a8a348b9 60a911b7 852a3bb9 8ba949df 5a157ae
    y: 0 239b098 7584aea3 af4431db 2f3fa3f4 312c5ea9
    Random point
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6
    hidden_point (d*C1):
    x: 7 1f5fceb7 8269106c c1708600 cde8821b 38e0c7ee
    y: 2 d752fec4 40840001 be4a3e7f 347e7013 7f36ce97
    &raw_point:
    x: 0 68616c6c 6f0a0000 0 0 60000000
    y: 0 7a64a103 a296a42d 4130d375 23ef2cf2 3f1a3ec0
    raw_point.x
    0 68616c6c 6f0a0000 0 0 60000000
    &raw_data (point):
    x: bffff630 bbe72787 d25ef6fb 139332fc 90db35c4 fd129391
    y: 0 2 d6670f0 ab08aca3 8818adbe cf36881d
    raw_data (point):
    x: 0 68616c6c 6f0a0000 0 0 60000000
    y: 0 68616c6c 6f0a0000 0 0 60000000
    &raw_data (field):
    bffff630 bbe72787 d25ef6fb 139332fc 90db35c4 fd129391
    raw_data (field):
    0 68616c6c 6f0a0000 0 0 60000000
    =====OUT receive elgamal

    sent data
    0 68616c6c 6f0a0000 0 0 60000000
    received data (field)
    0 68616c6c 6f0a0000 0 0 60000000

    Advertisements
     
  • CG 9:13 pm on April 28, 2010 Permalink | Reply
    Tags: , ,   

    Now reading 

    Christof Paar, “Efficient VLSI Architectures for Bit-Parallel Computation in Galois Fields”, Dissertation, Institute for Experimental Mathematics, Universität Essen, Germany, 1994.

     
  • CG 6:11 am on April 25, 2010 Permalink | Reply
    Tags: berk sunar, ,   

    Now reading 

    1. B. Sunar, E. Savas and C. K. Koc. Constructing composite field representations for efficient conversion. IEEE Transactions on Computers, 52(11):1391-1398, November 2003.
    2. B. Sunar, An Efficient Basis Conversion Algorithm for Composite Fields with Given Representations IEEE Transactions on Computers, 54(8):992-997, August 2005.
     
    • Budi Rahardjo 6:42 am on April 25, 2010 Permalink | Reply

      oh no, more things to read …

      • CG 5:26 am on April 27, 2010 Permalink | Reply

        i have sent the files to you too 🙂 happy reading 😀

    • budi sulistyo 4:53 pm on April 26, 2010 Permalink | Reply

      Berusaha tetap bertahan di jalur riset… Pertemuan jumat tetap ya? He2
      Semangat!

      • CG 5:26 am on April 27, 2010 Permalink | Reply

        @budi sulis: kapan dong gabung diskusi lagi? 🙂

  • CG 4:42 am on April 25, 2010 Permalink | Reply
    Tags: hg init, programming tool, , splint, versioning   

    Interesting to read 

    1. http://en.wikipedia.org/wiki/Splint_%28programming_tool%29
    2. http://splint.org/
    3. http://hginit.com/
     
  • CG 5:04 pm on April 23, 2010 Permalink | Reply
    Tags: , ,   

    “problems in gcc” solved 

    After fussing about the compiler since yesterday and having nightmare last night about cannot finish the grad study before dec, apparently there’s nothing wrong with the compiler (hopefully). It’s only “typos”!

    Oh my! 😀 S**t happens. Especially during grad school 😀

     
    • Budi Rahardjo 5:21 am on April 24, 2010 Permalink | Reply

      grrrr …

      • Bobby 1:07 pm on April 24, 2010 Permalink | Reply

        paraaaah, makanya pakai editor yang rada bagusan, pake terminal mulu sih. ato settingan editornya pakai backgound yang warnanya jadi bikin mata ga cape walau koding lama banget.

        • CG 4:45 am on April 25, 2010 Permalink

          itu terlalu kontras ya untuk koding lama2x?

      • CG 4:44 am on April 25, 2010 Permalink | Reply

        @rahard: ampun 😀

        • Bobby 2:10 pm on April 26, 2010 Permalink

          @cg, sangat ga nyaman, mata akan lebih santai klo cahaya nya redup. coba aja pelototin lampu, ga enak kan.

  • CG 4:42 am on April 23, 2010 Permalink | Reply
    Tags: ,   

    Now reading: 

    Efficient Conversion Algorithm for Composite Field Representation, E. Savas, B. Sunar, C. K. Koc.

     
  • CG 11:04 am on April 22, 2010 Permalink | Reply
    Tags: connection, , , ms access, , web programming   

    How to connect Java with Microsoft Access 

    1. Install easysoft (download address: http://download.cnet.com/Easysoft-JDBC-ODBC-Bridge/3000-2065_4-10392636.html)
    2. Click ODBC Data Source Adminsitrator
    3. Choose System DSN Tab
    4. Click Add the fill in Data Source Name (ex: “test”, “my_db”)
    5. Click Select and choose the .mdb file then click OK
    6. Click Apply

    The code ( and should works ):

    import java.sql.*;
    public class Testdb
    {
    public static void main(String[] args)
    {
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:tes","","");
    Statement stmt = con.createStatement();

    //di DB saya ada tabel mhs dengan 3 field yaitu npm, nama dan alamat
    ResultSet rs = stmt.executeQuery("Select npm, nama, alamat from mhs");
    while (rs.next()) {
    int x = rs.getInt("npm");
    String s1 = rs.getString("nama");
    String s2 = rs.getString("alamat");
    System.out.println(x + " " + s1 + " " + s2 + "\n");
    }
    }
    catch (Exception e){
    System.out.println("Error: " + e);
    }

    }
    }

    Thanks to Lucky for sharing the how-to and the code.

    Useful links:

    1. http://oreilly.com/catalog/javadata/chapter/ch04.html
    2. http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2691&lngWId=2
    3. http://www.easysoft.com/applications/microsoft-access/jdbc-odbc.html
    4. http://java.sun.com/docs/books/tutorial/jdbc/overview/index.html
     
  • CG 5:59 am on April 18, 2010 Permalink | Reply
    Tags: ,   

    Composite field intro 

    From this paper:

    There is only one finite field of characteristic 2 for a given degree, and both the binary and composite fields refer to the same field although their representation methods are different.”

    GF(2^{k})
    B_{1}=\left \{ 1, \alpha , \alpha ^{2}, ... \alpha ^{k-1} \right \}
    A \in GF\left ( 2^{k} \right )
    A = \sum_{i=0}^{k-1} a_{i}.\alpha ^{i}
    where a_{0}, a_{2}, ... a_{k-1} \in GF\left ( 2 \right )

    ————–

    GF((2^n)^m)
    B_2 = {1, \beta, \beta ^2, .... \beta ^{m-1}}
    A \in GF((2^n)^m)
    A=\sum_{i=0}^{m-1}a'_i.\beta ^i
    where a'_0, a'_1, ...a'_m-1 \in GF(2^n)

    Examples:

    GF(2^8)
    B_1 = {1, \alpha, \alpha^2, ..., \alpha^7}
    A \in GF(2^8)
    A = \sum_{i= 0}^{7}a_i.\alpha^i
    a_0, a_1, ..., a_7 \in GF(2)

    ————–

    GF((2^2)^4)
    B_2 = {1, \beta, \beta^2, \beta^3}
    A \in GF((2^2)^4)
    A = \sum{i=0}^{2}a'_i.\beta^i
    a'_0, a'_1, a'_2 \in GF(2^2)

    There are still I’d like to add here but don’t have time to type it in excel or draw it using omnigraffle. I’ll just keep it on my phd logbook. Now going to read some more papers. And start coding.

     
  • CG 5:55 pm on April 17, 2010 Permalink | Reply
    Tags: , pointer,   

    Pointers are so cruel… 

    They’re bad! And mean!

    After weeks of debugging, and still cannot get the plaintext back, now I’m moving to the next: building ECC on composite fields.

    Note: below is the result of the codes with printf-s everywhere. With the help of this debugger.

    The algorithm seems correct but the data recovered looks weird.


    poly_prime =
    8 0 0 0 0 c9
    setting up curves

    the curve after setting up:
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    counter = 0
    inc = 5
    Base point
    x: 5 63323eab 10fc68f8 254d4d11 d2d518f2 9979dd24
    y: 4 883e6269 de8bf93e f6c224e3 330dbf7f 2dd25ec1

    create side 2's private key

    Side 2 secret:
    5 5d0be8bb a913fcdb 91edee60 4da6d486 295d85ac

    Generate side 2's public key

    Side 2 public key
    x: 1d5ba6c2 5378466 ae5d1cce 48770132 e9d6d710 a7448cd1
    y: 4 85500816 ccee8906 56a133dc 19c325f8 4bb9ffa6
    data =
    68616c6c 6f0a0000 0 0 0 60000000

    Hide data on curve and send from side 1 to side 2

    curve before send_elgamal:
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    Their_public before send_elgamal:
    x: 1d5ba6c2 5378466 ae5d1cce 48770132 e9d6d710 a7448cd1
    y: 4 85500816 ccee8906 56a133dc 19c325f8 4bb9ffa6
    =====IN send_elgamal=====
    data (in send_gamal function) :
    68616c6c 6f0a0000 0 0 0 60000000
    Base point
    x: 5 63323eab 10fc68f8 254d4d11 d2d518f2 9979dd24
    y: 4 883e6269 de8bf93e f6c224e3 330dbf7f 2dd25ec1
    Base curve
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    random value:
    5 3a0f94f6 e0caf9a7 2d189f04 8591c5e5 3935d4dc
    Random point C1
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6
    counter = 0
    inc = 0
    counter = 0
    -- pnt->x =
    x: bffff4b8 a00754ec bffff4d8 a0073a58 a a
    y: 68616c6d 6f0a0000 0 0 0 60000000
    raw point M (after poly_embed)
    x: 68616c6d 6f0a0000 0 0 0 60000000
    y: 1 2c310f6b e4c3751c 2ef637ef ce837cb2 88e21c99
    Their_public:
    x: 1d5ba6c2 5378466 ae5d1cce 48770132 e9d6d710 a7448cd1
    y: 4 85500816 ccee8906 56a133dc 19c325f8 4bb9ffa6
    hidden point (after poly_elptic_mul)
    x: 6 987b3fe3 f486168f 19bba08c b943f599 c43cfa22
    y: 1 6a16b493 afad94b4 f93c6f41 40281e42 8c448f24
    Hidden data (C2):
    x: 68616c6c d3ba4b92 8c4b46c0 a6c78778 afcaf788 5187c979
    y: 68616c69 372ef71c 96586e6d bad28a2 ff127133 b48ca3de
    Random point (C1):
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6
    =====OUT send_elgamal

    AFTER send_elgamal
    curve after send_elgamal:
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    Hidden data (C2)
    x: 68616c6c d3ba4b92 8c4b46c0 a6c78778 afcaf788 5187c979
    y: 68616c69 372ef71c 96586e6d bad28a2 ff127133 b48ca3de
    Random point (C1)
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6

    Recover transmitted message

    IN receive_elgamal
    Base curve in receive_elgamal
    form: 1
    a2: 0 0 0 0 0 2
    a6: 0 0 0 0 0 1

    Hidden_data (in receive_elgamal) :
    x: 68616c6c d3ba4b92 8c4b46c0 a6c78778 afcaf788 5187c979
    y: 68616c69 372ef71c 96586e6d bad28a2 ff127133 b48ca3de
    Random point
    x: 2 d6670f0 ab08aca3 8818adbe cf36881d 83accc06
    y: 2 cad560f5 72c889b5 226934a2 733455c8 c53a15a6
    hidden_point (d*C1):
    x: 7 1f5fceb7 8269106c c1708600 cde8821b 38e0c7ee
    y: 2 d752fec4 40840001 be4a3e7f 347e7013 7f36ce97
    &raw_point:
    x: 68616c6a de301be6 24719966 c269b54f ef049a08 8c7af389
    y: 3 fae10821 85e832bb b9c6d8ab cc4439f4 eb7441ea
    raw_point.x
    68616c6a de301be6 24719966 c269b54f ef049a08 8c7af389
    &raw_data (point):
    x: bffff670 10700ccf af82abf6 b46a9779 16316b62 7df7f7d
    y: 4037177 debca93c 4b16e65 77a8ff5a 70c28f88 1d5ba6c1
    raw_data (point):
    x: 68616c6a de301be6 24719966 c269b54f ef049a08 8c7af389
    y: 68616c6c 6f0a0000 0 0 0 60000000
    &raw_data (field):
    bffff670 10700ccf af82abf6 b46a9779 16316b62 7df7f7d
    raw_data (field):
    68616c6a de301be6 24719966 c269b54f ef049a08 8c7af389
    =====OUT receive elgamal

    sent data
    68616c6c 6f0a0000 0 0 0 60000000
    received data (point)
    x: 68616c6a de301be6 24719966 c269b54f ef049a08 8c7af389
    y: 68616c6c 6f0a0000 0 0 0 60000000
    received data (field)
    68616c6a de301be6 24719966 c269b54f ef049a08 8c7af389

     
    • Budi Rahardjo 7:11 pm on April 17, 2010 Permalink | Reply

      masih belum selesai debuggingnya. kayaknya mau ngerapihin code-nya dulu

      • CG 8:15 pm on April 17, 2010 Permalink | Reply

        be careful. the pointers like to behave unexpectedly anytime we alter the code. bad pointers! grrrrrr!!!

  • CG 1:48 pm on April 8, 2010 Permalink | Reply
    Tags: , ,   

    Houston, we cannot recover the plaintext 


    poly_prime =
    8 0 0 0 0 c9
    data test =
    68616c6c 6f0a0000 0 0 0 6000000
    setting up curves

    the curve after setting up:
    form: 1
    a2: 2 0 0 0 0 0
    a6: 1 0 0 0 0 0

    counter = 0
    inc = 5
    Base point
    x: 5 63323eab 10fc68f8 254d4d11 d2d518f2 9979dd24
    y: 7 95f678a8 39481c22 2f4c7995 4a571060 6fe263b2

    create side 2's private key

    Side 2 secret:
    5 5d0be8bb a913fcdb 91edee60 4da6d486 295d85ac

    Generate side 2's public key

    Side 2 public key
    x: d107f500 66784cc8 9a0621db 9050de48 31c6e7c5 7d65d83b
    y: 2 1763b098 91e23a1e 2f96df5c 50c63a33 a4b16c75

    Hide data on curve and send from side 1 to side 2

    counter = 0
    inc = 0
    counter = 0
    -- pnt->x =
    x: bffff4d8 1 bffff508 90483f7b a0073a58 905e07e8
    y: 100131 1000 0 bffff7a0 bffff71c 1ed5
    counter = 1
    -- pnt->x =
    x: bffff4d8 1 bffff508 90483f7b a0073a58 905e07e8
    y: 100132 1000 0 bffff7a0 bffff71c 1ed5
    Hidden data
    x: 100135 70f0eb24 c996c3e4 2d120279 e9f3ec30 3370129a
    y: 100132 7a61b198 ccba8673 27995624 c069db6f ab7bdfaa
    Random point
    x: d107f503 81d255cd 358038a7 148e84da a7b39f16 75d320c4
    y: 3 e0053e42 6538a7a0 41dabd3 4cb90701 9a31b3b0

    Recover transmitted message

    sent data
    100130 1000 0 bffff7a0 bffff71c 1ed5
    received data
    d117f431 a8e83258 f59857d7 646d8b77 90191393 f6674925

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel