Skip to content

CFB encryption/decryption segment size error may be incorrect #29

Open
@rderwin

Description

@rderwin

I am using this library to decrypt a CFB cipher 40 characters long, with a segment size of 16. It fails from this error:

if ((plaintext.length % this.segmentSize) != 0) {
throw new Error('invalid plaintext size (must be segmentSize bytes)');
}

However, when removing these line I am able to successfully decode the string.

Is this error incorrect? I was thinking segmentSize would be in bits and not bytes, so 40 bytes should be divisible into 16 bits without issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions