Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>sx_setpass():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_SetPass():

  Syntax:   Sx_SetPass( <cString> )

        cString = String of data to be used in all subsequent Sx_Encrypt()
                  and Sx_Decrypt() calls.  The string may be up to 8 bytes
                  long.  This value is case-sensitive.  For example, a
                  string encrypted with the password "BOGUS" would be
                  different than if the password "bogus" were used.

                  To clear the password, pass a null string ("") as the
                  parameter.

      NOTE:  Make sure to trim all trailing spaces from the password before
             passing it on to the Sx_SetPass() function, unless the spaces
             are intended to be part of the password.

  Returns:  Nothing.

  Description:  A single call to Sx_SetPass() should be made prior to
                any encryption or decryption functions.

                After setting a password with Sx_SetPass(), all new records
                appended in the current workarea will be encrypted as they
                are stored.

                If a file or string was encrypted without first setting the
                security code via Sx_SetPass(), it would also need to be
                decrypted without calling Sx_SetPass().  That way the same
                code, in this case eight ASCII 0's, will be used for both
                encryption and decryption.

                For additional security the security code is stored in
                memory in an encrypted form.  Therefore, the security code
                is not easily accessed at runtime.

     NOTE:  The password set by Sx_SetPass() is workarea-specific.  It is
            NOT global.


  Example:

    // Open TEST.DBF and set FOOBAR as the encryption password for this
    // workarea.  Then, encrypt TEST.DBF

    USE test VIA "SIXCDX" EXCLUSIVE
    Sx_SetPass( "FOOBAR" )
    ? "Encrypting TEST.DBF: "
    ?? iif( Sx_DBFencrypt(), "OK", "ERROR" )

    // Open TEST2.DBF and set BOGUS as the encryption password for this
    // workarea.  Then, encrypt TEST2.DBF.

    USE test2 VIA "SIXCDX" NEW EXCLUSIVE
    Sx_SetPass( "BOGUS" )
    ? "Encrypting TEST2.DBF: "
    ?? iif( Sx_DBFencrypt(), "OK", "ERROR" )


  NOTE:  If you accidentally decrypt a DBF file with the wrong password,
         you'll need to follow these steps to decrypt it properly:

          1.  Re-Encrypt the table using the same WRONG password.
          2.  Now decrypt the DBF file with the correct password.



See Also: Sx_Encrypt() Sx_Decrypt() Sx_DBFencrypt() Sx_DBFdecrypt()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson