OTS_RSA __construct(
[string
$p = self::OTSERV_P], [string
$q = self::OTSERV_Q], [string
$d = self::OTSERV_D]
)
|
|
Initializes new encryption session.
Initializes new encryption session.
If you won't pass any parameters default OTServ keys will be generated. It is recommended action for compatibility with oryginal Tibia servers and clients as well as default Open Tibia implementation.
Note: You must be sure your p, q and d values are proper for RSA keys generation as class won't change it for you.
Parameters:
|
string |
$p: |
Key part. |
|
string |
$q: |
Key part. |
|
string |
$d: |
Key part. |
API Tags:
Information Tags:
| Version: | 0.1.2 |
| Throws: | LogicException When BCMath extension is not loaded. |
| Since: | 0.1.2 |
string decrypt(
string
$message
)
|
|
Decrypts RSA-encrypted message.
Decrypts RSA-encrypted message.
As OTServ clients use RSA encryption only for sending requests we don't need decryption here. If it will be needed, then this method will be implemented. At the moment it will throw exception.
Parameters:
|
string |
$message: |
RSA-encrypted message. |
API Tags:
| Return: | Decrypted content. |
| Access: | public |
Information Tags:
| Version: | 0.1.2 |
| Throws: | LogicException Always as this method is not implemented. |
| Since: | 0.1.2 |
Implementation of:
- IOTS_Cipher::decrypt()
- Decrypts encrypted message.
string encrypt(
string
$message
)
|
|
Ecnrypts message with RSA algorithm.
Ecnrypts message with RSA algorithm.
Parameters:
|
string |
$message: |
Message to be encrypted. |
API Tags:
| Return: | Encrypted message. |
| Access: | public |
Information Tags:
| Version: | 0.1.2 |
| Since: | 0.1.2 |
Implementation of:
- IOTS_Cipher::encrypt()
- Ecnrypts message.