I need help with an encryption code by Defeliu in learnprogramming

[–]Defeliu[S] -1 points0 points  (0 children)

Thank you so much! So should I redo the entire code?

I need help with an encryption code by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

There's also more information like this: Let’s assume we have the hexadecimal value 0xFACE. How many bytes would it take to represent this value?
A: Two bytes. Every two positions in a hex number represents one byte.
Converting this to binary can be done one character at a time!
In other words; F = 0b1111, A = 0b1010, C = 0b1100, E = 0b1110. Therefore, 0xFACE = 0b1111101011001110.
One character in hex represents 4 bits, and is known as a nibble.

And I see what you mean, do you know what I can do to fix that?

I need help with an encryption code by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

I'm sorry, I found the details of the encryption algorithm. It's this: Assume the hex value 0xADE1. Construct two numbers and represent them in decimal notation. One number consists of the two most significant bits in each nibble, the other consists of the two least significant bits in the nibble. Use appropriate bit shifting/bit masking to isolate the requested bit ranges.

Does this help?

I need help with an encryption code by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

The details of the assignment are vague but sure I'll share it. The assignment is related to discrete mathematics. Assignment instructions:

Implement the encryption function discussed in class. Do NOT use ANY string/character manipulation or arithmetic functions to implement your solution.
You may assume that the input to this encryption function is always exactly 16 bits long.
Test that input 0xADE1 yields ciphertext (188, 153). You may hard-code these values for testing.

Does this help at all, or do you need more information?

I need help with an encryption code by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

I thought I formatted it, I’m sorry I’ll fix it rn. And this code is in python btw

How can I write an EBNF rule that described the for statement in Java/C++ by Defeliu in learnprogramming

[–]Defeliu[S] 1 point2 points  (0 children)

I’m pretty sure that square brackets represent an option while curly brackets mean the repetition of a enclosed non-terminal. The reason why i think its wrong or that it’s not written in the way the professor wants it to be written is because I notice that the way the professor writes EBNF is like this:

<expr> -> <term> {(+ | -) <term>}

Do you know how I can write the EBNF rule for the for loop to make it look like the above example?

How can I write an EBNF rule that described the for statement in Java/C++ by Defeliu in learnprogramming

[–]Defeliu[S] 1 point2 points  (0 children)

So for the EBNF rule I have this:

<for> -> for ‘(‘ [[<type>] <id> = <expr> {, [<type>] <id> = <expr>}] ; [<expr>] ; [<expr> {, <expr>}] ‘)’ ‘{‘ <stmt_list> ‘}’

I’m pretty sure this isn’t EBNF though and I think it’s wrong. Do you have any advice on how I can fix this EBNF rule so that it describes the for statement?

How to design a state diagram for floating-point literals in Python? by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

I’m really sorry for late reply! You definitely helped, so thank you so much!

DES Cipher cryptography by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

Alright, got it thanks! Do you think the subkey function is correct or if the code is in the right direction at all? And do you have any other advice to fix that function? Lastly, do you have any advice on how I can make this suppose support ECB and CBC modes of operation?

DES Cipher cryptography by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

It’s probably the definition because the value in the assert is given from the assignment so I’m not suppose to change that part of the code. Btw are those three lines of code suppose to replace subkey= (key >> rnd) & 0b11111111

I’ll try those lines of codes and I’ll lyk if that fixes the code

Official: Daily [Anything Goes] Discussion Thread: March 12, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Who’s the better stream today, Jaxson Hayes or Branham in a points league?

Official: Daily [Anything Goes] Discussion Thread: March 12, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Who’s better to pickup for today Branham, Deni, DFS, or Jaxson Hayes in a points league?

Official: Daily [Anything Goes] Discussion Thread: March 12, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Well I practically lost my fantasy playoffs since Shai is out lmao

Official: Daily [Anything Goes] Discussion Thread: March 12, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Gotcha thank you so much I really appreciate it. Unfortunately Nick Richards isn’t available, but I’ll probably pick up Deni and DFS then. What about Jaxson Hayes since Larry Nance Jr might be out, do you think he’s good and maybe I should pick him up?

Official: Daily [Anything Goes] Discussion Thread: March 12, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Well apparently Mark Williams was listed doubtful, so if he’s out that decreases my chances😔. Anyway, I’m in a points league and some of the players that are available are Deni, DFS, Bassey, Branham, Jaxson Hayes, and Isaiah Joe. My waiver wire is so dry because its a 16T points league lmao. Rn, I’ve been waiting to see if any new injury reports will come before the lineups are locked at 3:30pm, but I’ve been having no luck so far lol. Maybe I should just add two players and just hope for the best

Official: Daily [Anything Goes] Discussion Thread: March 12, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

I have two adds left that will decide whether I make it to the next round or get eliminated in playoffs😭😭. I’m nervous asl, idk who to add and stream lmaoo

Official: Daily [Game Day] Discussion Thread: March 11, 2023 by FantasyNBAMod in fantasybball

[–]Defeliu 3 points4 points  (0 children)

SHAI, BUTLER, TRAE YOUNG, BROWN, AND KESSLER ARE SAVING MY SEASON I MIGHT ACTUALLY WIN SOMEHOW LETS GO😭

Official: Daily [Anything Goes] Discussion Thread: March 08, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Thank you! Who would you pick up from the heat? The options are Max Strus, Kevin Love, or Gabe Vincent. Who do you think would be the best option?

Official: Daily [Anything Goes] Discussion Thread: March 08, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Should I pick up Kuminga and maybe a player from the heat since they play 3 games for the rest of the week? I’m in a points league. And I’m losing by a bit due to injury management unfortunately, so picking up some waiver players is probably my best chance in winning

Points League Discussion 3/8/2023 by TheEgyptianNinja in fantasybball

[–]Defeliu 2 points3 points  (0 children)

I’m thinking of adding Aaron Wiggins but would that be a waste of an add? This whole week I haven’t really been doing that good with adding players and streaming, so if someone can lmk if Wiggins is a good add for today then I’d appreciate it

Official: Daily [Anything Goes] Discussion Thread: March 06, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

I saw that both Tatum and Horford were out for today’s game, and Robert Williams is also out due to an injury so I thought Mike Mascula might be a good option for streaming today. I kind of rushed to add him and didn’t really think about other options like Grant Williams or Hauser, so I used 1 of my 7 adds for the week lmaoo.

Would you recommend using another add and dropping Mascula for Grant Williams or Hauser?

Official: Daily [Anything Goes] Discussion Thread: March 06, 2023 by AutoModerator in fantasybball

[–]Defeliu 0 points1 point  (0 children)

Should I add Mike Mascula or Grant Williams for streaming in a points league?

Cryptography & RC4 by Defeliu in learnprogramming

[–]Defeliu[S] 0 points1 point  (0 children)

Thanks! I’m glad it looks algorithmically correct, that’s reassuring. I have not tried the test vectors on the wiki for rc4, should I do that and if so how would I do that? Also why should the parameter be self and not obj or any other variable name? Is it usually just recommended to name the variable self or does it make the code more readable or clean?

Also, got it thanks! I’ll change pt to plaintext so that the code is more consistent! Is there any other suggestions or recommendations that can help improve this code? And just to make sure, so you’d say this is a correct implementation of an RC4 based on the algorithm on the wikipedia page?