WhatsApp Decrypt

Descriptografa mídias do WhatsApp

Overview

This node decrypts encrypted WhatsApp media files. It is useful when you have media content from WhatsApp that is encrypted and you want to convert it back into its original, usable form. Common scenarios include processing audio messages, images, videos, documents, stickers, or thumbnails extracted from WhatsApp chats for further analysis, storage, or display.

For example, if you receive an encrypted audio message URL and its corresponding media key, this node can decrypt the audio so you can listen to it or save it in a readable format. Similarly, it can decrypt images or videos shared via WhatsApp.

Properties

Name Meaning
Media Type The type of WhatsApp media to decrypt. Options: Audio, Document, GIF, Image, Product, PTT (Voice Message), Sticker, Video, Thumbnail Document, Thumbnail Image, Thumbnail Video, Thumbnail Link, Message History, App State, Payment Background, PTV.
Media URL The URL pointing to the encrypted WhatsApp media file.
Media Key (Base64) The Base64-encoded media key used to decrypt the media.
Output Format The format of the decrypted output data. Options: Base64 (string), Buffer (binary data).

Output

The node outputs JSON with the following structure:

  • success: Boolean indicating whether decryption was successful.
  • mediaType: The media type specified in input.
  • outputFormat: The chosen output format.
  • decryptedData: The decrypted media content, either as a Base64 string or a binary buffer depending on the selected output format.
  • originalUrl: The original encrypted media URL.

If the output format is set to "Buffer (Binary)", the node also outputs binary data under the binary property with:

  • data: The decrypted media content encoded as Base64 (for n8n binary compatibility).
  • mimeType: The MIME type inferred from the media type (e.g., audio/ogg, image/jpeg, video/mp4).
  • fileName: A generated filename like decrypted_<mediaType>.bin.

Dependencies

  • Requires internet access to fetch the encrypted media from the provided URL.
  • Uses the axios library to perform HTTP GET requests.
  • Uses Node.js built-in crypto module for cryptographic operations (AES-256-CBC decryption and HMAC-SHA256 based HKDF).
  • No external API keys or credentials are required by the node itself, but the media URL must be accessible.

Troubleshooting

  • Unsupported Media Type Error: If you specify a media type not supported by the node, it will throw an error stating the media type is unsupported. Ensure you select one of the listed media types.
  • Network Errors: If the media URL is invalid, inaccessible, or times out, the node will fail to download the encrypted media. Verify the URL and network connectivity.
  • Invalid Media Key: Providing an incorrect or malformed Base64 media key will cause decryption to fail. Make sure the media key matches the encrypted media.
  • Decryption Failures: If the media key does not correspond to the media or the media is corrupted, decryption will throw errors. Double-check inputs.
  • The node supports continuing on failure; if enabled, it will output error details per item instead of stopping execution.

Links and References

Discussion