1

I am running FIPS test vectors against AES-CFB. I am getting correct results for aes-cfb128 and aes-cfb8 but getting wrong results for aes-cfb1. The values being used by me for aes-cfb1 tests are:

KEY = 10a58869d74be5a374cf867cfb473859
IV = 00000000000000000000000000000000
PLAINTEXT = 0 <===== Input text
CIPHERTEXT = 0

I am not getting any value for cipher or plain text while encoding and decoding it using aes-cfb1. Is it because of input value being read as Hex ? Is there any way to convert input plain text "0" to binary value in Linux ash shell ?

===========================
Correct Results for CFB128
===========================

KEY = 10a58869d74be5a374cf867cfb473859
IV = 00000000000000000000000000000000
PLAINTEXT = 00000000000000000000000000000000
CIPHERTEXT = 6d251e6944b051e04eaa6fb4dbf78465

[root@Controller]# echo 00000000000000000000000000000000 | xxd -r -p > plaintext
[root@Controller]# 
[root@Controller]# openssl enc -aes-128-cfb -p -nopad -nosalt -K 10a58869d74be5a374cf867cfb473859 -iv 00000000000000000000000000000000 -in plaintext -out ciphertext
key=10A58869D74BE5A374CF867CFB473859
iv =00000000000000000000000000000000
[root@Controller]# xxd -p ciphertext > ciphertextssd
[root@Controller]# cat ciphertextssd
6d251e6944b051e04eaa6fb4dbf78465 <============================================= Correct Result
[root@Controller]# 

============================
In-Correct Results for CFB1
============================

KEY = a2e2fa9baf7d20822ca9f0542f764a41
IV = 00000000000000000000000000000000
PLAINTEXT = 0
CIPHERTEXT = 1

[root@Controller]# echo 0 | xxd -r -p > plaintext
[root@Controller]# 
[root@Controller]# openssl enc -aes-128-cfb1 -p -nopad -nosalt 
-K a2e2fa9baf7d20822ca9f0542f764a41 -iv 00000000000000000000000000000000 -in pla
intext -out ciphertext
key=A2E2FA9BAF7D20822CA9F0542F764A41
iv =00000000000000000000000000000000
[root@Controller]# xxd -p ciphertext > ciphertextssd
[root@Controller]# 
[root@Controllerh]# cat ciphertextssd
[root@Controller]# <=================================== No Result whereas it should be 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.