Skip to content

Certain decks run into an error after encrypting 35 chrs of plaintext #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
airgap0 opened this issue May 14, 2023 · 1 comment
Open

Comments

@airgap0
Copy link

airgap0 commented May 14, 2023

When encrypting 1600 "A" everything runs ok but after 1629 of "A" this message "deck after step 4 of keystream...." is put out. Subsequent input of "A" would be consequently encryptet as "L" plus the error-message mentioned above.
When the deck is changed into:

`#deck_original=(C_A C_2 C_3 C_4 C_5 C_6 C_7 C_8 C_9 C_10 C_J C_Q C_K D_A D_2 D_3 D_4 D_5 D_6 D_7 D_8 D_9 D_10 D_J D_Q D_K H_A H_2 H_3 H_4 H_5 H_6 H_7 H_8 H_9 H_10 H_J H_Q H_K S_A S_2 S_3 S_4 S_5 S_6 S_7 S_8 S_9 S_10 S_J S_Q S_K A_Joker B_Joker)
#deck=(C_A C_2 C_3 C_4 C_5 C_6 C_7 C_8 C_9 C_10 C_J C_Q C_K D_A D_2 D_3 D_4 D_5 D_6 D_7 D_8 D_9 D_10 D_J D_Q D_K H_A H_2 H_3 H_4 H_5 H_6 H_7 H_8 H_9 H_10 H_J H_Q H_K S_A S_2 S_3 S_4 S_5 S_6 S_7 S_8 S_9 S_10 S_J S_Q S_K A_Joker B_Joker)

#Alt_deck
deck_original=(S_A S_4 C_K S_J H_A H_Q C_5 C_3 S_6 D_J C_9 D_2 H_9 H_3 C_Q S_10 H_5 D_K C_7 H_10 S_K H_K D_10 S_3 H_4 C_4 C_A D_6 H_8 H_6 S_9 H_J S_8 S_2 D_5 D_4 S_5 D_A S_Q H_2 C_2 D_Q H_7 C_8 B_Joker C_6 D_8 D_7 D_3 S_7 A_Joker C_10 C_J D_9)
deck=(S_A S_4 C_K S_J H_A H_Q C_5 C_3 S_6 D_J C_9 D_2 H_9 H_3 C_Q S_10 H_5 D_K C_7 H_10 S_K H_K D_10 S_3 H_4 C_4 C_A D_6 H_8 H_6 S_9 H_J S_8 S_2 D_5 D_4 S_5 D_A S_Q H_2 C_2 D_Q H_7 C_8 B_Joker C_6 D_8 D_7 D_3 S_7 A_Joker C_10 C_J D_9)
`
an error occurs even after 35 charakters of plaintext. Here the message is:

./sol.sh: line 425: 1 + : syntax error: operand expected (error token is "+ ")

To investigate further I let echo the deck in

`function generating_keystream () {

#CHECK
echo ${deck[@]}
`
This issue arises with Ubuntu in a wsl subsystem running win11 as well as with a raspberrypi running the latest Raspbian. The respective versions of bash are
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
and
GNU bash, Version 5.0.3(1)-release (aarch64-unknown-linux-gnu)

Attached you will find the sol.sh (modified to use a certain deck and to echo the deck) plus the output of the encryption of 1630 "A"s with the vanilla deck.
error.txt
sol.sh.txt

@airgap0
Copy link
Author

airgap0 commented May 14, 2023

When investigating further into this issue I found out that whenever
deck after step 4 of keystream is: .... arises, the Jokers are in the top position in the deck. Joker_A (the short jump) is in the topmost position followed by Joker_B - the one that jumps 2 cards down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant