Eureka Encryption Library Help
Procedures and Examples
However you are referencing the library, either by an IDE application, in C++ directly, or applications like REALBasic,
consult the documentation on defining and using shared libraries. With the exception of EurTEnc, EurTDec, EurBEnc, EurBDec
(all these return strings), all other function return an integer. See Status Codes below for returned values.
The list of functions and how they are defined in C++ are as follows:
int EurGenTextKeys(char cmd[500]);
int EurGenBinaryKeys(char cmd[500]);
int EurShutDown(void);
char* EurTEnc(char cmd[8192]);
char* EurTDec(char cmd[8192]);
char* EurBEnc(char cmd[8192]);
char* EurBDec(char cmd[8192]);
int EurBinaryFileDec (char srcfile[500], char cryptfile[500]);
int EurBinaryFileEnc (char srcfile[500], char cryptfile[500]);
int EurTextFileDec(char srcfile[500], char cryptfile[500]);
int EurTextFileEnc(char srcfile[500], char cryptfile[500]);
int EurBExpandFileDec(char srcfile[500], char cryptfile[500]);
int EurBExpandFileEnc(char srcfile[500], char cryptfile[500]);
int EurTExpandFileDec(char srcfile[500], char cryptfile[500]);
int EurTExpandFileEnc(char srcfile[500], char cryptfile[500]);
int EurScrambleFile(char srcfile[500], blocknum as int, blocksize as int);
int EurXScramble(char srcfile[500]);
int EurKillFile(filename[500]);
EurBDec(encstring)
This routine decrypts a Binary string previously encrypted and returns the decrypted string. The string buffer size is 8k (8192 bytes).
The EurGenBinaryKeys must be called prior to using this routine.
Example:
C++ strcpy(decstr,EurBDec(encstring));
Basic decstring=EurBDec(encstring)
EurBEnc(stringtocrypt)
This routine encrypts a Binary string and returns the encrypted string. The varible passed returns the encrypted data. Note that in C++ you should
check the strlen of the returning string against the string length of the passed string. The reason for this is that
Nulls (chr(0)) are valid characters with Eureka, not just a string terminator. If the string lengths are different you
will need to access each element of the returned string to get the complete result.
The EurGenBinaryKeys must be called prior to using this routine.
Example:
C++ strcpy(encstr,EurBEnc(stringtocrypt));
Basic encstring=EurBEnc(stringtocrypt)
Example in C dealing with Nulls within the returning string:
strcpy(teststr,"Hello world.");
origlen=strlen(teststr);
strcpy(enc,EurBEnc(teststr));
if(strlen(enc)!=origlen) {
for(z=0;z<origlen;z++) {
enc[z]=teststr[z];
}
}
EurBExpandFileDec(encfile, decfile)
This routine will decrypt an expanded encrypted Binary File. The passed parameters are the
encryptedfilename and the file to receive the decrypted data. They cannot be the same file. The function
returns an integer. See Status Codes below.
The EurGenBinaryKeys must be called prior to using this routine.
Examples:
C++ int dec=EurBExpandFileDec(encryptedfile,decryptedfile);
Basic intval=EurBExpandFileDec(encryptedfile,decryptedfile)
EurBExpandFileEnc(srcfile, cryptfile)
This routine will decrypt an expanded encrypted Binary File. The passed parameters are the
sourcefilename and the file to receive the encrypted data. They cannot be the same file. The function
returns an integer. See Status Codes below.
The EurGenBinaryKeys must be called prior to using this routine.
No errors will be produced and the file size will be identical to the original
filesize.
Examples:
C++ int dec=EurBExpandFileEnc(srcfile,encryptedfile);
Basic intval=EurBExpandFileEnc(srcfile,encryptedfile)
EurBinaryFileDec(encryptedfile, decryptedfile)
This routine will decrypt an encrypted Binary File. The passed parameters are the encrypted file and the file to
have the ecrypted data. They cannot be the same file.
The EurGenBinaryKeys must be called prior to using this routine.
No errors will be produced and the file size will be identical to the original
filesize.
Examples:
C++ int dec=EurBinaryFileDec(encfile, decfile);
Basic intval=EurBinaryFileDec(encfile, decfile)
EurBinaryFileEnc(sourcefile, encrytedfile)
This routine will encrypt a file in Binary mode. The passed parameters are the encrypted file and the file to
have the ecrypted data. They cannot be the same file.
The EurGenBinaryKeys must be called prior to using this routine.
No errors will be produced and the file size will be identical to the original
filesize.
Examples:
C++ int dec=EurBinaryFileEnc(srcfile, encfile);
Basic intval=EurBinaryFileEnc(srcfile, encfile)
EurGenBinaryKeys(Keystr)
This call will generate the Binary data files that will be used for Binary
processing. The parameter (Key) is the string of a number between 1 and
999,999,999,999,999,999.(no commas) The number used should be used as a string and can contain alpha characters as well.
Example:
C++ int key=EurGenBinaryKeys("A445Gik6824415");
Basic intval=EurGenBinaryKeys("123456789BB4")
All Binary mode cryptions can now be called after the conclusion of this call. This
call should only be used once for the life of the application or changed from one key system to another, and if used in
conjuction with the EurGenTextKeys, the same sequence of generation must be
followed. Note: You should make sure that the call completes. It has been reported
that with some development packages, it will return before it has finished processing.
Therefore, it is a good idea to place a 'delay' of two seconds after the call to ensure
that all of the files it creates are completed before another routine is called.
EurGenTextKeys(Keystr)
This call will generate the Text data files that will be used for Text
processing. The parameter (Key) is the string of a number between 1 and
999,999,999,999,999,999.(no commas) The number used should be used as a string and can contain alpha characters as well.
Example:
C++ int key=EurGenBinaryKeys("A445Gik6824415");
Basic intval=EurGenBinaryKeys("123456789BB4")
All Text mode cryptions can now be called after the conclusion of this call. This
call should only be used once for the life of the application or changed from one key system to another, and if used in
conjuction with the EurGenBinaryKeys, the same sequence of generation must be
followed. Note: You should make sure that the call completes. It has been reported
that with some development packages, it will return before it has finished processing.
Therefore, it is a good idea to place a 'delay' of two seconds after the call to ensure
that all of the files it creates are completed before another routine is called.
EurKillFile(filename)
The standard Kill or remove command might not be strong enough. Use this for sensitive
data files that need to be sure to be deleted. Pass the filename you want to
securely delete and it will be extremely difficult to recover, if at all.
Example:
C++ int result=EurKillFile("/home/test/somefile");
Basic intval=EurKillFile("/home/test/somefile")
EurScrambleFile(filename, Blocknum, Blocksize)
There are two types of calls associated with Scrambling. With
the EurScrambleFile you supply the number of blocks, the blocksize to use and
the filename of the file you wish to scramble. The following example will scramble the file using 10 blocks of 100 blocks
each. Only the first thousand characters will therefore be scrambled.
Example:
C++ int scram=EurScrambleFile(filename, 10, 100);
Basic intval=EurScrambleFile(filename, 10, 100)
EurShutDown
This call should be made when you exit your application or going to issue another EurGenTextKeys or EurGenBinaryKeys. The data files used
in the cryptive processes will be removed to keep the data secure. You will
need to perform another EurGenBinaryKeys or EurGenTextKeys routine before any
cryptions can take place.
No parameters are required.
Example:
C++ int kill=EngShutdown();
Basic intval=EngShutdown()
EurTDec(string)
This routine decrypts a Text string previously encrypted. The resulting string is returned if successful, otherwise
it will contain the error message.
The EurGenTextKeys must be called prior to using this routine.
Example:
C++ strcpy(decstr,EurTDec(encryptedstring));
Basic decstring=EurTDec(encryptedstring)
EurTEnc(string)
This routine encrypts a Text string. The resulting string is returned if successful, otherwise
it will contain the error message.
The EurGenTextKeys must be called prior to using this routine.
Example:
C++ strcpy(enc, EurTEnc(string));
Basic encstr=EurTEnc(string)
EurTExpandFileDec(encryptedfile, decryptedfile)
This routine will decrypt an expanded encrypted Text File. The passed parameters are the
encryptedfilename and the file to receive the decrypted data. They cannot be the same file. The function
returns an integer. See Status Codes below.
The EurGenTextKeys must be called prior to using this routine.
No errors will be produced and the file size will be identical to the original
filesize.
Examples:
C++ int dec=EurTExpandFileDec(encfile, decfile);
Basic intval=EurTExpandFileDec(endfile, decfile)
EurTExpandFileEnc(sourcefile, encryptedfile)
This routine will encrypt a file in Text mode and include expansion. The passed parameters are the
sourcefilename and the file to receive the encrypted data. They cannot be the same file. The function
returns an integer. See Status Codes below.
The EurGenTextKeys must be called prior to using this routine.
No errors will be produced and the file size will be identical to the original
filesize.
Examples:
C++ int dec=EurTExpandFileDec(encfile, decfile);
Basic intval=EurTExpandFileDec(endfile, decfile)
EurTextFileDec(encryptedfile, decryptedfile)
This routine will decrypt an encrypted Text File. The passed parameters are the
sourcefilename and the file to receive the encrypted data. They cannot be the same file. The function
returns an integer. See Status Codes below.
The EurGenTextKeys must be called prior to using this routine.
No errors will be produced and the file size will be identical to the original
filesize.
Examples:
C++ int dec=EurTextFileDec(encfile, decfile);
Basic intval=EurTextFileDec(encfile, decfile)
EurTextFileEnc(sourcefile, encryptedfile)
This routine will encrypt a file in Text mode. The passed parameters are the
sourcefilename and the file to receive the encrypted data. They cannot be the same file. The function
returns an integer. See Status Codes below.
The EurGenTextKeys must be called prior to using this routine.
No errors will be produced and the file size will be identical to the original
filesize.
Examples:
C++ int dec=EurTextFileEnc(srcfile, encfile);
Basic intval=EurTextFileEnc(srcfile, encfile)
EurXScrambleFile(filename)
There are two types of calls associated with Scrambling. With
EurXScramble the same parameters in the Expand routines are used. This will
allow a 'random' logic rather than a set block/blocksize scramble.
Either a EurGenBinaryKeys or EurGenTextKeys call must be made before calling
this routine.
Examples:
C++ int scram=EurXScramble(filename);
Basic intval=EurXScramble(filename)
STATUS CODES
0 = No Errors
1 = Missing System files. Either EurGenTextKeys or EurGenBinaryKeys are required.
2 = Missing or invalid Source File.
3 = Missing or invalid Crypted File.
4 = Invalid blocknum and/or blocksize.
5 = Blocknum/size exceeds filesize.
Often the passed variable will return with the error string if status does not equal 0.
Back to Menu
Support and technical issues can be directed via eureka@datasecuritysolutions.com
Copyright © 1994-2000, 2002, 2003, 2005, 2007 Data Security Solutions, Inc. All rights reserved.