Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: problem with rsa

  1. #1
    xoder
    Guest

    Question problem with rsa

    hello all,

    im just having a closer look at a program thats using a 64-bit rsa protection. working with some tutorials and other docs i got to this point:
    .text:00409BEC push esi ; empty miracle variable
    .text:00409BED mov ecx, [eax]
    .text:00409BEF mov eax, [edx]
    .text:00409BF1 push ecx ; push n
    .text:00409BF2 mov ecx, [esp+18h+arg_4]
    .text:00409BF6 push eax ; push e
    .text:00409BF7 mov edx, [ecx]
    .text:00409BF9 push edx ; push my entered serial
    .text:00409BFA call _powmod ; serial^e mod n
    as far as i understand its encrypting(decrypting?) my serial with the powmod function from the miracl library.for e,n,d,p,q i got the following numbers:

    n=81B95467E440DD59
    p=D5C477E9
    q=9B5A43F1
    d=49352151A885660D
    e=101B445
    after it has encrypted my serial it uses

    .text:00409C47 call _cotstr
    to make the result to string(im not really sure if i understood the miracl documentation right)
    after its done with converting there is a compare routine that checks the result from encryption(decryption?) to the following string: B60FE67B
    my problem is that im getting pretty confused how to calculate my serial to be B60FE67B after it got encrypted(decrypted?)

    should i encrypt it before with: B60FE67B^e mod n
    or : B60FE67B^d mod n
    (i think i tried both but no luck seems im not getting something right here)


    regards xoder
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    human_thought
    Guest
    Hello xoder,
    and hello to everyone in this forum.This seems to be a very nice rce place,which for some weird reason i found out only recently.

    as far as i understand its encrypting(decrypting?) my serial with the powmod function from the miracl library.for e,n,d,p,q i got the following numbers:
    It's really encrypting your serial since the powmod function has a parameter for the public key(e).So if you have a comparison to a static value that has to be fulfilled,you have to perform RSA decryption:

    Static_Value ^ d mod N = Serial

    This should be your correct serial i guess...


    human_thought
    Last edited by human_thought; February 11th, 2004 at 12:28.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  3. #3
    xoder
    Guest

    another question

    well i tried but it still doesnt work, seems there is something i havent seen in this protection, gonna have a closer look.

    could someone possibly post a small visual studio .net project here that uses the miracl library? im trying to get it running since 3 hours no luck. maybe someone knows how to get it running, it would help me alot on getting some feeling for rsa.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    Red wine, not vodka! ZaiRoN's Avatar
    Join Date
    Oct 2001
    Location
    Italy
    Posts
    922
    Blog Entries
    17
    Hi xoder,
    im trying to get it running since 3 hours no luck
    Which is exactly your problem between .net and miracl library?

    Zai

  5. #5
    xoder
    Guest
    i found some project on the web, lemme see if i can get it working it seems i included the wrong headers.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  6. #6
    Red wine, not vodka! ZaiRoN's Avatar
    Join Date
    Oct 2001
    Location
    Italy
    Posts
    922
    Blog Entries
    17
    Ok but also take a look at the MSVISUAL file located inside miracl directory (if I am not wrong...), it explains all the tasks you need to do in order to set-up a working project.
    Personally, I use to include 'miracl.h' and add ms32.lib to the project... it works :-)

    Good luck,
    ZaiRoN

  7. #7
    xoder
    Guest
    well yeah that was the first thing i was stuck, i didnt find a way to insert ms32.lib into the project. at least it didnt work the way it was described in the msvisual.txt since i use visual studio .net 2003. do you have a clue how it works in vs .net 2k3?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  8. #8
    xoder
    Guest
    it seems i got them added, but it still refuses to run. i did the following steps to get them into the project:
    1. open project properties tab
    2. go to linker
    3. add ms32.lib and bc32.lib to additional dependencies
    4. include "big.h"

    result: fatal error LNK1136: invalid or corrupt file

    any ideas?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  9. #9
    human_thought
    Guest
    Have you also include miracl.h?


    human_thought
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  10. #10
    Red wine, not vodka! ZaiRoN's Avatar
    Join Date
    Oct 2001
    Location
    Italy
    Posts
    922
    Blog Entries
    17
    Hi,
    the method you used to add the lib file is correct.
    bc32.lib is designed for borland c++ compiler, if you use .net you don't need to add it to your project.
    Code:
    LNK1136: The input file either has a corrupt header or is zero size or abnormally small.
    I never seen this error, maybe one of the file is really corrupted... is this error referred to a particular file?

    Later,
    Zai

  11. #11
    xoder
    Guest
    human_thought, neither including miracl.h nor big.h worked, i just tried big.h cause i saw it in a project i found on the web and i thought its worth a try...

    zai: no its a general error i just get the project name as reference. while reading through msvisual.txt i came across a point that tells to recompile the miracl lib when using it with visual studio mfc, is that really necessary?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  12. #12
    Red wine, not vodka! ZaiRoN's Avatar
    Join Date
    Oct 2001
    Location
    Italy
    Posts
    922
    Blog Entries
    17
    I don't use mfc and I don't know if it's really necessary but, it's often better to follow these 'hints'

  13. #13
    xoder
    Guest
    ok, im gonna try my luck with a (hopefully successful) recompile. i gonna let you know if it helped.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  14. #14
    xoder
    Guest
    i actually managed to rebuild the miracl library with tons of warnings during build process. now i have another problem when trying to use it. i include "big.h" into my project also put "big.cpp" into it. but when trying to compile my program i get tge following errors:
    1. error LNK2005: _multiply already defined in miracl2.lib(mrmodmul.obj)
    2. error LNK2005: _redc already defined in miracl2.lib (mrmodmul.obj)

    any ideas how to fix this?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  15. #15
    xoder
    Guest
    ok i got one step further again... i build the library a second time and now the redefinition error from my previous post is gone. in my project i include the "big.h" and "big.cpp" and i can at least compile it without errors. the problem now is that when i try to create an instance of big the program crashes with an unhandeled exception that comes from on of the Big() constructors....since i dont seem to get this stuff running, does anyone know how to fix this or if there are other libraries to use for bignum calculations?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. Thanks +Tsehp, problem solve Isp problem :)
    By esther in forum Advanced Reversing and Programming
    Replies: 1
    Last Post: October 28th, 2000, 07:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •