How to set plaintext value?

Maybe I’m misunderstanding how ChipWhisperer Lite works, but I am setting these parameters:

cap.setParameter(['Key/Text Pattern', 'Fixed Plaintext', True])
cap.setParameter(['Key/Text Pattern', 'Fixed Plaintext Value', myPlainText])
cap.setParameter(['Key/Text Pattern', 'Fixed Plaintext Key', myPlainText])
cap.setParameter(['Key/Text Pattern', 'Fixed Encryption Key', myKey])

However, the textin.npy file has values like:

0x60:0x9e:0xf6:0xf9:0x99:0x2:0x97:0x27:0xbc:0x38:0x6:0xe4:0x2d:0x8c:0xc4:0x7b
0xe5:0xa4:0x95:0x8c:0xbf:0x7:0x68:0xb2:0xae:0x41:0xfa:0x65:0x91:0x78:0x97:0x1e
0x27:0x35:0xa:0x32:0xe5:0x9e:0x25:0x50:0xa9:0xec:0x63:0xa7:0xc7:0xec:0xfb:0x70
0x77:0x86:0x40:0xc5:0xbd:0x2c:0x1b:0x38:0x7:0xb5:0x77:0x7:0x80:0xb1:0xec:0x80
0x53:0xd4:0x4e:0xa0:0x15:0x71:0x56:0x37:0x66:0x74:0x99:0x5e:0xee:0x8:0x3d:0xa4
0x39:0x20:0xa5:0x3f:0x5b:0x4c:0x64:0xf0:0xdd:0xc0:0x32:0x9b:0x5b:0xad:0x73:0x7a
0x51:0xf9:0xa0:0x62:0x1a:0xbd:0x5f:0x26:0xd:0x9b:0xf4:0x13:0x9a:0x27:0x70:0x50
0x0:0x28:0xb7:0xf6:0xd4:0xa3:0xc3:0x7:0x7a:0x65:0x7a:0x67:0x9b:0x63:0x8d:0xb1
0x5b:0x15:0xf0:0xd7:0xd0:0x6b:0xe7:0xe1:0x32:0x2a:0xaa:0x67:0x28:0x6:0x7a:0x6a
0x5:0x5c:0xc2:0xe8:0xbb:0xc9:0x41:0x69:0x97:0x32:0xa6:0xc5:0x79:0xbb:0xad:0xe4
0x9:0x26:0x33:0xbe:0x98:0xa:0x4:0xca:0xa3:0xfe:0xf1:0x95:0xf9:0x67:0xb3:0x52
0xa0:0x33:0x1b:0xe0:0x91:0xa7:0x2c:0x80:0x29:0x71:0x59:0xfa:0x46:0xa4:0xc0:0xdb
0xb0:0x3:0x7d:0x52:0x44:0x39:0xf:0x2:0x13:0x50:0xac:0xb3:0x44:0x82:0x2a:0x8a
0xfd:0xaf:0x29:0x96:0x36:0xbc:0xd5:0x61:0xc8:0x6e:0x2b:0x2a:0x1e:0x6f:0x27:0x86

Why is ChipWhisperer Lite encrypting random text and not my specified plaintext?
Thank you.

Hello,

Hmm… will check that. There is a huge update to the GIT repo right now, so it may have introduced bugs. I think your understanding is correct in how it “should” work, but something went wrong…

Regards,

-Colin

For what it’s worth, I’m using version 0.12RC1 from the website, not code pulled from the repo. Also, the CWCapture.pyw app shows the proper key and text values, despite not being in textin.npy.

Sorry on the slow response - I was trying to chase this down in the old version and still didn’t have success, is it still an issue? Is there a chance you can try a newer version, I’m not sure why this wouldn’t work as has been used for some time…

-Colin

It’s working, I realised I had the wrong parameter. This ended up fixing it.

cap.setParameter(['Key/Text Pattern', 'Plaintext', 'Fixed'])

I actually have the same problem. I try to use the same fixed list of plaintexts with different encryption keys.
However, I don’t manage to feed the capture process with a list contained in a textin.npy. Is there a simple way to do that thanks to the configuration files (.cfg) or do we need to change the python capture script ?

Regards,

pam

Hi Pam,

I don’t think the ChipWhisperer Capture software can use a list of fixed plaintexts. The options are to use a single fixed plaintext of your choice or to use a random plaintext on every iteration. The textin.npy file is there so that you can tell which random plaintexts were used, which lets you implement side-channel attacks (in the ChipWhisperer Analyzer program or in your own Python scripts).

Basically, the Capture software supports known plaintext attacks, but not chosen plaintext attacks. Does that make sense?

Hi Greg, how are you? :slight_smile:

Actually its easy to do what he wants. He just need to create a new file, similar to:
chipwhisperer/software/chipwhisperer/capture/acq_patterns/basic.py

It needs to extend AcqKeyTextPattern_Base and implement the relevant methods. Take a look at these links for more information:
wiki.newae.com/Adding_Modules/Parameters
viewtopic.php?f=7&t=202

Hey Adriel - I’m glad to be back!

This is definitely possible - I just mean that it’s not implemented yet! Feel free (Pam or anyone else) to add this feature to the Capture software :slight_smile: