IPWorks Encrypt 2020 PHP Edition

Questions / Feedback?

Elgamal Class

Properties   Methods   Events   Configuration Settings   Errors  

Encrypt and decrypt data with the Elgamal asymmetric key encryption algorithm for public-key cryptography.

Class Name

IPWorksEncrypt_Elgamal

Procedural Interface

 ipworksencrypt_elgamal_open();
 ipworksencrypt_elgamal_close($res);
 ipworksencrypt_elgamal_register_callback($res, $id, $function);
 ipworksencrypt_elgamal_get_last_error($res);
 ipworksencrypt_elgamal_get_last_error_code($res);
 ipworksencrypt_elgamal_set($res, $id, $index, $value);
 ipworksencrypt_elgamal_get($res, $id, $index);
 ipworksencrypt_elgamal_do_config($res, $configurationstring);
 ipworksencrypt_elgamal_do_createkey($res);
 ipworksencrypt_elgamal_do_decrypt($res);
 ipworksencrypt_elgamal_do_encrypt($res);
 ipworksencrypt_elgamal_do_reset($res);

Remarks

The ElGamal class is used to encrypt/decrypt data with the Elgamal asymmetric key encryption algorithm for public-key cryptography.

To begin you must either specify an existing key or create a new key. Existing public or private keys may be specified by setting the Key* properties. To create a new key pair call CreateKey.

After specifying a key, specify the data you wish to encrypt or decrypt. Call the Encrypt or Decrypt method to perform the operation.

Input and Output Properties

The class will determine the source and destination of the input and output based on which properties are set.

The order in which the input properties are checked is as follows:

When a valid source is found the search stops. The order in which the output properties are checked is as follows:

An Elgamal key is made up of a number of individual parameters.

The public key consists of the following parameters:

The class also includes the KeyPublicKey property which holds the PEM formatted public key for ease of use. This is helpful if you are in control of both signature creation and verification process. When sending the public key to a recipient note that not all implementations will support using the PEM formatted value in KeyPublicKey in which case the individual parameters must be sent.

The private key consists of the following parameters:

The class also include the KeyPrivateKey property which holds the PEM formatted private key for ease of use. This is helpful for storing the private key more easily.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

InputFileThe file to process.
InputMessageThe message to process.
KeyGRepresents the G parameter for the Elgamal algorithm.
KeyPRepresents the P parameter for the Elgamal algorithm.
KeyPrivateKeyThis property is a PEM formatted private key.
KeyPublicKeyThis property is a PEM formatted public key.
KeyXRepresents the X parameter for the Elgamal algorithm.
KeyYRepresents the Y parameter for the Elgamal algorithm.
OutputFileThe output file when encrypting or decrypting.
OutputMessageThe output message after processing.
OverwriteIndicates whether or not the class should overwrite files.
RecipientKeyGRepresents the G parameter for the Elgamal algorithm.
RecipientKeyPRepresents the P parameter for the Elgamal algorithm.
RecipientKeyPublicKeyThis property is a PEM formatted public key.
RecipientKeyYRepresents the Y parameter for the Elgamal algorithm.
UseHexWhether input or output is hex encoded.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
CreateKeyCreates a new key.
DecryptDecrypts the input data using the specified private key.
EncryptEncrypts the input data using the recipient's public key.
ResetResets the class.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

ErrorInformation about errors during data delivery.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

KeySizeThe size, in bits, of the secret key.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 PHP Edition - Version 20.0 [Build 8155]