48-bit baton

Is there an implementation (Java / C ++ / Ruby) of the Blowfish algorithm that supports 48-bit data blocks? I have a problem with encryption where the input and output channels are 48 bits. All implementations on the network are designed for 64-bit blocks.

+1
source share
3 answers

This is because Blowfish has a given block size of 64 bits. You can place two random bytes at the end of your data.

require 'rubygems'
require 'crypt/blowfish'
blowfish = Crypt::Blowfish.new("A key up to 56 bytes long")
plain="123456"
encryptedBlock = blowfish.encrypt_block(plain+(rand(250)+5).chr+(rand(250)+5).chr)

or if yours plainmay be less than 6 bytes / 48 bits

encryptedBlock = blowfish.encrypt_block(plain.ljust(8))
+3
source

counter-mode blowfish. , .

( ), 64 . XOR 48 , . .

- . , 48 . , -, ?

+2

RC4-drop 1024. RC4 - , , 48 , . Drop 1024 , 1024 PRNG, 1024 .

BitTorrent Message Stream Encryption uses RC4-drop 1024, and a python implementation using the ARC4 library is implemented here:

http://google.com/codesearch/p?hl=en#4FSOSMZ6Pxc/distfiles/BitTorrent-5.0.7.tar.gz|eyN-AXYL_0E/BitTorrent-5.0.7/BitTorrent/Connector.py&q=lang:python% 20% 22ARC4.new% 22

+1
source

Source: https://habr.com/ru/post/1762905/


All Articles