mathbdw/whatsapp-stream-encryption-test

Test task PSR-7 Stream decorators for WhatsApp encryption algorithms

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/mathbdw/whatsapp-stream-encryption-test

v2.0.1 2025-06-17 19:24 UTC

This package is auto-updated.

Last update: 2025-12-17 20:41:53 UTC


README

composer require mathbdw/whatsapp-stream-encryption-test

Usage

Encrypt stream

$pathIn = './static/IMAGE.original'; $pathOut = './static/IMAGE.encrypted'; $key = './samples/IMAGE.key';

$encryption = new \WhatsApp\StreamEncryption\Models\EncryptWhatsAppStreamImage($pathIn, $pathOut); $encryption->exec($key);

The key is not required. If there is no key after encryption, the key file will be added to the output file folder.

$pathIn = './static/IMAGE.original';
$pathOut = './static/IMAGE.encrypted';

$encryption = new \WhatsApp\StreamEncryption\Models\EncryptWhatsAppStreamImage($pathIn, $pathOut);
$encryption->exec();

Decrypt stream

$pathIn = './static/IMAGE.encrypted';
$pathOut = './static/IMAGE.original';
$key = './samples/IMAGE.key';

$decryption = new \WhatsApp\StreamEncryption\Models\DecryptWhatsAppStreamImage($pathIn, $pathOut); $decryption->exec($key);

Type file encryption

  //Video
  $enStream = new \WhatsApp\StreamEncryption\Models\EncryptWhatsAppStreamImage($pathIn, $pathOut);
  $deStream = new \WhatsApp\StreamEncryption\Models\DecryptWhatsAppStreamImage($pathIn, $pathOut);
  //Audio
  $enStream = new \WhatsApp\StreamEncryption\Models\EncryptWhatsAppStreamAudio($pathIn, $pathOut);
  $deStream = new \WhatsApp\StreamEncryption\Models\DecryptWhatsAppStreamAudio($pathIn, $pathOut);
  //Image
  $enStream = new \WhatsApp\StreamEncryption\Models\EncryptWhatsAppStreamImage($pathIn, $pathOut);
  $deStream = new \WhatsApp\StreamEncryption\Models\DecryptWhatsAppStreamImage($pathIn, $pathOut);
  //Document
  $enStream = new \WhatsApp\StreamEncryption\Models\EncryptWhatsAppStreamDocument($pathIn, $pathOut);
  $deStream = new \WhatsApp\StreamEncryption\Models\DecryptWhatsAppStreamDocument($pathIn, $pathOut);