Blowfish class

Implements the Blowfish encryption algorithm

Provides methods for encrypting and decrypting data using the Blowfish cipher in both ECB and CBC modes with various padding options.

Example:

final cipher = Blowfish(
  key: Encoding.stringToU8('myKey'),
  mode: Mode.cbc,
  padding: Padding.pkcs5
);

Constructors

Blowfish({required Uint8List key, required Mode mode, required Padding padding})
Creates a new Blowfish cipher instance

Properties

hashCode → int
The hash code for this object.
no setterinherited
iv ↔ Uint8List?
Initialization vector for CBC mode
getter/setter pair
mode → Mode
The encryption mode (ECB or CBC)
final
p ↔ List<int>
P-array for the Blowfish algorithm
getter/setter pair
padding → Padding
The padding method to use
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
s ↔ List<List<int>>
S-boxes for the Blowfish algorithm
getter/setter pair

Methods

decode(dynamic data, {Type returnType = Type.string}) → dynamic
Decodes data using the configured mode and padding
encode(Uint8List data) → Uint8List
Encodes data using the configured mode and padding
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setIv(Uint8List value) → void
Sets the initialization vector for CBC mode
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited