Loading...
Searching...
No Matches
juce::BlowFish Class Reference

## Detailed Description

BlowFish encryption class.

The documentation for this class was generated from the following file:

- juce_cryptography/encryption/juce_BlowFish.h

## Public Member Functions

| BlowFish (const void *keyData, int keyBytes)
| Creates an object that can encode/decode based on the specified key.
| BlowFish (const BlowFish &)
| Creates a copy of another blowfish object.
BlowFish & | operator= (const BlowFish &) noexcept
| Copies another blowfish object.
| ~BlowFish () noexcept
| Destructor.
void | encrypt (uint32 &data1, uint32 &data2) const noexcept
| Encrypts a pair of 32-bit integers.
void | decrypt (uint32 &data1, uint32 &data2) const noexcept
| Decrypts a pair of 32-bit integers.
void | encrypt (MemoryBlock &data) const
| Encrypts a memory block.
void | decrypt (MemoryBlock &data) const
| Decrypts a memory block.
int | encrypt (void *buffer, size_t sizeOfMsg, size_t bufferSize) const noexcept
| Encrypts data in-place.
int | decrypt (void *buffer, size_t bytes) const noexcept
| Decrypts data in-place.

## Constructors and Destructors

## BlowFish() [1/2]

juce::BlowFish::BlowFish | ( | const void * | keyData,
|  | int | keyBytes )

Creates an object that can encode/decode based on the specified key.

The key data can be up to 72 bytes long.

Referenced by BlowFish(), decrypt(), and operator=().

## BlowFish() [2/2]

juce::BlowFish::BlowFish | ( | const BlowFish & |  | ) |

Creates a copy of another blowfish object.

References BlowFish().

## ~BlowFish()

juce::BlowFish::~BlowFish | ( |  | ) |

noexcept

Destructor.

## Member Functions

## operator=()

BlowFish & juce::BlowFish::operator= | ( | const BlowFish & |  | ) |

noexcept

Copies another blowfish object.

References BlowFish().

## encrypt() [1/3]

void juce::BlowFish::encrypt | ( | uint32 & | data1,
|  | uint32 & | data2 ) const

noexcept

Encrypts a pair of 32-bit integers.

References encrypt().

Referenced by encrypt(), encrypt(), and encrypt().

## decrypt() [1/3]

void juce::BlowFish::decrypt | ( | uint32 & | data1,
|  | uint32 & | data2 ) const

noexcept

Decrypts a pair of 32-bit integers.

References decrypt().

Referenced by decrypt(), decrypt(), and decrypt().

## encrypt() [2/3]

void juce::BlowFish::encrypt | ( | MemoryBlock & | data | ) | const

Encrypts a memory block.

References encrypt().

## decrypt() [2/3]

void juce::BlowFish::decrypt | ( | MemoryBlock & | data | ) | const

Decrypts a memory block.

References decrypt().

## encrypt() [3/3]

int juce::BlowFish::encrypt | ( | void * | buffer,
|  | size_t | sizeOfMsg,
|  | size_t | bufferSize ) const

noexcept

Encrypts data in-place.

Parameters

  buffer | The message that should be encrypted. See bufferSize on size requirements!
  sizeOfMsg | The size of the message that should be encrypted in bytes

  bufferSize

  The size of the buffer in bytes. To accommodate the encrypted data, the buffer must be larger than the message: the size of the buffer needs to be equal or greater than the size of the message in bytes rounded to the next integer which is divisible by eight. If the message size in bytes is already divisible by eight then you need to add eight bytes to the buffer size. If in doubt simply use bufferSize = sizeOfMsg + 8.

Returns
  The size of the decrypted data in bytes or -1 if the decryption failed.

References encrypt().

## decrypt() [3/3]

int juce::BlowFish::decrypt | ( | void * | buffer,
|  | size_t | bytes ) const

noexcept

Decrypts data in-place.

Parameters

  buffer | The encrypted data that should be decrypted
  bytes | The size of the encrypted data in bytes

Returns
  The size of the decrypted data in bytes or -1 if the decryption failed.

References BlowFish(), decrypt(), and JUCE_LEAK_DETECTOR.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited