0

I need to create a Rc2Key variable and then convert this to hexadecimal. I have done this with two commands. The Rc2Key variable has to be 16 characters long, so in my test module I used "DummyRC2Key1" as the Rc2Key.

Rc2Key="DummyRC2Key1"

HexRc2Key=$(printf "${Rc2Key}" | xxd -p)

With that done I need to pad the CTF keys with eight 0s. I did this with the following commands and output this padded list to CTFpadlist.csv

zeros=00000000

while read CTFlist; do echo $CTFlist$zeros; done < CTFlist.csv > CTFpadlist.csv

With the padded CTF's and the HexRc2Key, I need to encrypt the CTFpadlist.csv

while read CTFpadlist; do echo -n "$CTFpadlist" | xxd -r -p | openssl enc -rc2-cbc -nopad -K "${HexRc2Key}" -iv 0000000000000000 | xxd -plain | tr d '/n'; done < CTFpadlist.csv > EncCTFlist.csv

Here is the problem—my hex comes out with "/" like so:

24a8/be115/59a9/c62bbfe6249fbc/44af127fcf97a0a43

This is not an acceptable hex. What am I doing wrong here?

0

Rather than

tr d '/n'; 

you probably meant

tr -d '\n'; 
  • Thank you sirby you pointing out the improper placement i located the problem. just by deleting the '/n' fixed the problem. Thank you – DJLee Apr 25 '16 at 21:14
  • how do i accept it? i clicked the up arrow – DJLee Apr 25 '16 at 21:17
  • nevermind...duhh – DJLee Apr 25 '16 at 21:18

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.