adnanshah247 Posted November 18, 2009 Share Posted November 18, 2009 Guys im badly stuck on a coursework assignment of mine for uni. its within my IT Security module and i have to basically know about these things in detail. i have read and read and cant make sense of it at all. these are some aspects:- *Public and private key ciphers *Euclidean algorithm's *RSA Cipher has driven me insane for the last few days. anybody willing to offer me some tuition, will obviously pay for all time taken PLEASE HELP GUYS! This is my coursework assignment and honestly i have no idea what the hell im doing:- QUESTION 1 (35 MARKS) Let p = 1889, q = 2003, and e = 61. Show that (e, n) defines a valid public key pair for an RSA cipher system. Determine the corresponding private key pair (d, n), and the block size for encryption. Encrypt: DIGITAL FORTRESS [ Hint: Use MS Excell for your calculations ] Explain your answers. QUESTION 2 (30 MARKS) Given the initial 8-bit LFSR [ 01101100 ], and the primitive polynomial x^7 + x^6 + 1. 1. Use the corresponding stream cipher to encrypt the word: PRIVACY. 2. Use the same stream cipher to decrypt the ciphertext : 11000 10101 01011 (Hint: The English alphabet characters are to be represented by 5-bit binary of their numerical order: A= 00001, B= 00010, C= 00011, ..., Z= 11010, and space = 00000). Explain your answers QUESTION 3 (35 MARKS) Apply the DES round function with the plaintext block P = 1000 1001 1010 1011 1100 1101 1110 1111 0000 0001 0010 0011 0100 0101 0110 0111 Using the subkey: Ki = 101010 100011 010011 110011 101011 110101 010110 000101 Quote Link to comment Share on other sites More sharing options...
supra_aero Posted November 18, 2009 Share Posted November 18, 2009 You're a joker Adnan. lol. I am an econmist by nature, sorry so cant help. When's it in for? (Gosh not said that for years!) That looks very very complicated! BTW won't your lecturer be able to google this and see your name next to it ? Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 You're a joker Adnan. lol. I am an econmist by nature, sorry so cant help. When's it in for? (Gosh not said that for years!) That looks very very complicated! BTW won't your lecturer be able to google this and see your name next to it ? mate it blooody well is! i foooking hate ciphers and algorithms. Quote Link to comment Share on other sites More sharing options...
Thorin Posted November 18, 2009 Share Posted November 18, 2009 Just put 42 down for every answer. Or perhaps go back and read your course notes? Quote Link to comment Share on other sites More sharing options...
caseys Posted November 18, 2009 Share Posted November 18, 2009 Got a friend who is a bit of an encryption boffin, I'll send him a text and see if he can assist... Quote Link to comment Share on other sites More sharing options...
pedrosixfour Posted November 18, 2009 Share Posted November 18, 2009 Thats all very well Ad and we will get to your little problem in due time but we all know the real question that people have sought the answer to and thus far have been left wanting is this. What does the red button do? I don't know mate, can't you write a few pages of absolute non-sensical (GUTRHj uiOIO OUITYHOI IIYRE NJH) jargon on the answer sheet and then tell the examiners that if they are so smart they should be able to crack your code too? Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 Just put 42 down for every answer. Or perhaps go back and read your course notes? im on a 1st at the moment in my degree and however much i have struggled have managed to understand what im going but this is just a really next level dilemma. i have read and read my notes but cant put it into context thank you so much, really appreciate it Thats all very well Ad and we will get to your little problem in due time but we all know the real question that people have sought the answer to and thus far have been left wanting is this. What does the red button do? I don't know mate, can't you write a few pages of absolute non-sensical (GUTRHj uiOIO OUITYHOI IIYRE NJH) jargon on the answer sheet and then tell the examiners that if they are so smart they should be able to crack your code too? the lecturers are class A w@nkers. they 'no offence' are all outside of the UK and their english is at times very hard to understand, especially when they explain stuff like this, they wiz through it and expect us to magically understand it all! Quote Link to comment Share on other sites More sharing options...
caseys Posted November 18, 2009 Share Posted November 18, 2009 Ok, i'm gonna have a crack at question 1 myself, I have never done RSA encryption and haven't touched algebra or functions since A-Level maths p = 1889 q = 2003 e = 61 n = modulus for both public + private key = pq = 1889x2003 = 3783667 totient = φ(pq) = (p − 1)(q − 1). totient = φ(pq) = (p − 1)(q − 1) = (1888)x(2002) = 3779776 going by this: Choose an integer e such that 1 so 1 so 1 φ(pq) = number of positive integers less than or equal to (pq), I assume as you're doing a degree in either computer science or cryptography that you know how to calculate a totient, I'm at work and on a conference call so don't have the time to work that value out) as you will have to check that both 61 and φ(pq) are both coprime numbers Anyway, (e, n) = (61, 3783667) = 230803687 public key pair... i think, you'll have to check. To determine d, de is defined as 1 (mod φ(pq)) To check that d is correct you can do ((ed) -1)/ φ((p-1)(q-1)) will give a whole number d is the private key exponent Public key is derived from the modulus n and the public exponent e Private key is derived from the modulus n and the private exponent d (as worked out with above forumlae) Block size for encryption will be the storage size required to store the integer of the private and public keys. Probably 1024 or 2048-bit. Unless this is quite noddy which it seems to be with a low value of p, q and e from what I can find. Ok so now encryption... I am assuming you need to turn DIGITAL FORTRESS into an integer to transmit it I assume you're also going to use a padding scheme?? So that you and the target intendee know how to encrypt text? So, you turn your message DIGITAL FORTRESS into an integer value, 'm' , where 0 To then decrypt 'c' at the target you would then do m = c^d (mod n) So you are using the cipher text to the power of the exponent d and modulus of n and should then derive the same number m that was ciphered, in turn that'd then be translated back to text with the padding scheme. BTW tell them RSA sucks and they should use at least Triple-DES encryption or 128-bit AES. And that e is a sucky value at 61. I'll let you know if my friend gets back to me, but this was my partial attempt at Q1 without pen, paper or a scientific calculator to hand. EDIT : WTF sort of mickey mouse s*** suggestion is it to use Excel for calculations?? Quote Link to comment Share on other sites More sharing options...
AndyT Posted November 18, 2009 Share Posted November 18, 2009 Ok, i'm gonna have a crack at question 1 myself, I have never done RSA encryption and haven't touched algebra or functions since A-Level maths p = 1889 q = 2003 e = 61 n = modulus for both public + private key = pq = 1889x2003 = 378667 totient = φ(pq) = (p − 1)(q − 1). totient = φ(pq) = (p − 1)(q − 1) = (1888)x(2002) = 3779776 going by this: Choose an integer e such that 1 so 1 so 1 φ(pq) = number of positive integers less than or equal to (pq), I assume as you're doing a degree in either computer science or cryptography that you know how to calculate a totient, I'm at work and on a conference call so don't have the time to work tha tavlue out) as you will have to check that both 61 and φ(pq) are both coprime numbers Anyway, (e, n) = (61, 378667) = 23098687 public key pair... i think, you'll have to check. To determine d, de is defined as 1 (mod φ(pq)) To check that d is correct you can do ((ed) -1)/ φ((p-1)(q-1)) will give a whole number d is the private key exponent Public key is derived from the modulus n and the public exponent e Private key is derived from the modulus n and the private exponent d (as worked out with above forumlae) Block size for encryption will be the storage size required to store the integer of the private and public keys. Probably 1024 or 2048-bit. Unless this is quite noddy which it seems to be with a low value of p, q and e from what I can find. Ok so now encryption... I am assuming you need to turn DIGITAL FORTRESS into an integer to transmit it I assume you're also going to use a padding scheme?? So that you and the target intendee know how to encrypt text? So, you turn your message DIGITAL FORTRESS into an integer value, 'm' , where 0 To then decrypt 'c' at the target you would then do m = c^d (mod n) So you are using the cipher text to the power of the exponent d and modulus of n and should then derive the same number m that was ciphered, in turn that'd then be translated back to text with the padding scheme. BTW tell them RSA sucks and they should use at least Triple-DES encryption or 128-bit AES. And that e is a sucky value at 61. I'll let you know if my friend gets back to me, but this was my partial attempt at Q1 without pen, paper or a scientific calculator to hand. EDIT : WTF sort of mickey mouse s*** suggestion is it to use Excel for calculations?? :blink: How, what....need an over the head smiley big time. Quote Link to comment Share on other sites More sharing options...
Soop Dogg Posted November 18, 2009 Share Posted November 18, 2009 damn....beat me to it. Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 THANKS A MILLION CASEYS!!!!! going to try and understand now how you did question 1. I managed to do question 2!!!!!!!!!!!!!!!!!!!! only 3 left. Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 Ok, i'm gonna have a crack at question 1 myself, I have never done RSA encryption and haven't touched algebra or functions since A-Level maths dude can you please check your figure for 'n' as i got 3783667 and you got 378667. seems like 1 digit is missed im really lost here dude. this is the format we have to use in order to do the answer (were using euclidien tables): QUESTION 1 Q1_n = Replace this text with your answer, e.g. 123456 *** Q1_phi = Replace this text with your answer, e.g. 123456 *** Q1_Euclidean= i d(i) k(i) x(i) 0 ... ... ... 1 ... ... ... 2 ... ... ... 3 ... ... ... 4 ... ... ... 5 ... ... ... 6 ... ... ... 7 ... ... ... 8 ... ... ... 9 ... ... ... 10 ... ... ... *** Q1_d = Replace this text with your private RSA key (d), e.g. 1234567 *** Q1_bs = Replace this text with your block size, e.g. 3 *** Q1_Encryption= Plain x x^2 mod n x^4 mod n x^8 mod n x^16 mod n x^32 mod n ... ... ... ... ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 *** Q1_C = Replace this text with your RSA cipher-text, e.g. 1234 # 1234 # 1234 # 1234 # 1234 *** Q1_comments Replace this text with your comments and explanations *** Quote Link to comment Share on other sites More sharing options...
caseys Posted November 18, 2009 Share Posted November 18, 2009 dude can you please check your figure for 'n' as i got 3783667 and you got 378667. seems like 1 digit is missed You are indeed correct and well spotted of my deliberate mistake. Ahem. My laptop keyboard has gone a bit wonky ever since it drank half a red bull. It's fine in the mornings but when the laptop heats up it seems to get a bit sticky keyboard wise for some reason Edit : therefore the public key value is also wrong, which I'll now go back and edit. the value did seem a little weak. Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 dude how the hell do you work out the block size of a message using RSA? thats the thing confusing me and my friend the most here! Quote Link to comment Share on other sites More sharing options...
Matt H Posted November 18, 2009 Share Posted November 18, 2009 wow..... Perhaps a read of Dan Brown's Digital Fortress May Help Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 Help! Quote Link to comment Share on other sites More sharing options...
caseys Posted November 18, 2009 Share Posted November 18, 2009 dude how the hell do you work out the block size of a message using RSA? thats the thing confusing me and my friend the most here! The block size is the size you require to fit in both the public key and private key values. so for instance how many values could you fit into a 16-bit address size if you had to encode alpha-numeric values into it? Quote Link to comment Share on other sites More sharing options...
gaz1 Posted November 18, 2009 Share Posted November 18, 2009 jeez is all this mumbo jumbo going to help you get through life then:blink: Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 jeez is all this mumbo jumbo going to help you get through life then:blink: i bloody hope so! Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 18, 2009 Author Share Posted November 18, 2009 spent all day trying to do question 1, its not happening Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 19, 2009 Author Share Posted November 19, 2009 woo hoooooo, 12 hours later i have managed to do question 2 and 3!!!! only b@stard, son of *itch, m@ther foookin question 1 left Quote Link to comment Share on other sites More sharing options...
Matt H Posted November 19, 2009 Share Posted November 19, 2009 I showed it to my mum last night and asked if she could do it. She said she probably could, but she's just to busy at the moment mate.. Sorry, tried for ya though Quote Link to comment Share on other sites More sharing options...
adnanshah247 Posted November 20, 2009 Author Share Posted November 20, 2009 i did it!!! managed to figure it out!!! wooo hooo!!!!! thanks to all those that helped especially Caseys! OWE U ONE BUDDY!!! Quote Link to comment Share on other sites More sharing options...
stinboy Posted November 20, 2009 Share Posted November 20, 2009 Good stuff - now stop shouting! Lets have a chat about currency swaptions next.... Quote Link to comment Share on other sites More sharing options...
caseys Posted November 20, 2009 Share Posted November 20, 2009 Good stuff - now stop shouting! Lets have a chat about currency swaptions next.... I'd like to get into that myself in my own free time but as I work for an investment bank looking at swaps is not allowed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.