CryptoSys API Library Manual

Compiling with C

The API has been compiled and tested successfully with Microsoft Visual C++ (versions 5, 6, 7, 8 (VS2005/Express 2005) and VS2008) and Borland C++Builder version 5.5.

Here is some minimal code:-

/* myapisource.c */
#include <stdio.h>
#include "diCryptoSys.h"
int main()
{	
  char *message = "abc";
  long ret;
  char digest[41]; 
  ret = SHA1_StringHexHash(digest, message);
  printf("SHA1(%s)=\t%s\n", message, digest);
  printf("Correct =\t%s\n", "a9993e364706816aba3e25717850c26c9cd0d89d");
  return 0;
}

To create myapisource.exe with MSVC++:

cl myapisource.c diCryptoSys.lib

Running this program should result in

SHA1(abc)=      a9993e364706816aba3e25717850c26c9cd0d89d
Correct =       a9993e364706816aba3e25717850c26c9cd0d89d
[HOME]   [NEXT: Using With Borland C++...]

Copyright © 2001-9 D.I. Management Services Pty Ltd. All rights reserved.