locked
Cross-platform library for RSA digital signature verification

    General discussion

  • Could you advise any lightweight cross-platform C++ library for verifying RSA digital signatures? I would like to use the same codebase on WinRT, Android and iOS.

    I have looked at CryptoC++, Botan and OpenSSL, but they seem to be too heavyweight, and quite difficult to build.

    LibTomCrypt seems to be a bit simpler than the rest, however I couldn't get it to compile in a Visual Studio project yet.

    Has anyone managed to get LibTomCrypt to work on WinRT? Is there any other lightweight library to use?

    Monday, April 15, 2013 4:28 PM

All replies

  • Hi,

     

    Maybe migrate LibTomCrypt to WinRT is a hard job.

    By the way, there is Windows.Security namespace in Windows Store App. If your requirement is not so complex, you can try to use the API in this namespace.

    Please take a look of

    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/br229572.aspx

    And

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.security.cryptography.core.aspx

    Documents

     

    Best regards,

    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Jesse Jiang Wednesday, April 17, 2013 3:19 AM
    Wednesday, April 17, 2013 2:59 AM
  • Thanks for the reply!

    The problem with the Windows.Security namespace is that I would like to use the same C++ codebase on WinRT, Android and iOS, and I don't want to implement the signature verification part one by one on the different platforms.

    Since I posted the question, I managed to get the LibTomCrypt library compile and properly work (it correctly checks the signatures created in a server-side C# app), but only in an ordinary Win32 Console app. Now I am trying to adjust it to work in a Windows Store project as well, I will post here if I manage to do it.

    Wednesday, April 17, 2013 7:52 AM
  • I got the LibTomCrypt library to build in a WinRT project, it wasn't complicated after all.

    The following steps were needed:

    1. Add all the source files of the LibTomCrypt and the LibTomMath library to the WinRT C++ project (I put them in folders called libtomcrypt and libtommath, respectively).
    2. The libtommath, libtomcrypt and libtomcrypt\headers folders have to be added to the Additional Include Directories to make the source files find the appropriate headers.
    3. It has to be specified that LibTomCrypt will use the LibTomMath math library, and that the two libs are built together by using their source.
      For this, two preprocessor symbols have to be defined, LTM_DESC, LTC_SOURCE. I added these in the Project settings, but if you define them in a header file before including the LibTomCrypt header, that should work as well I guess.
    4. The last thing that a WinRT project uses Windows Runtime language extensions, with which C source files can not be compiled, thus this setting has to be switched off selectively for all the .c files in the project.

    After making the configuration changes above, the library properly compiles and works for me.

    Thursday, April 25, 2013 8:34 AM
  • I tried to use libraries LibTomCrypt on Win32Console Visual Studio 2010, but I have not managed to run test.cpp correctly.
    Can you give a step-by-step what must to do from start until successfully run a simple application?
    I've tried to move all the existing code files in the src folder to my project & I also
    defined LTM_DESC, LTC_SOURCEbefore include LibTomCrypt header,  but I still have not managed to build solution.
    I use libtomcrypt-1:17

    Thanks in advance.

    Friday, December 20, 2013 4:12 AM