×

Let's log you in.

or

Don't have a StudySoup account? Create one here!

×

or

IT 210

by: Ahmed Notetaker

6

0

2

IT 210 210

Ahmed Notetaker
Minnesota State University, Mankato
GPA 3.1

Get a free preview of these Notes, just enter your email below.

×
Unlock Preview

Friday week 3 of it 210
COURSE
Fundamentals of Programming
PROF.
Salivia, Guarionex
TYPE
Class Notes
PAGES
2
WORDS
CONCEPTS
information technology
KARMA
25 ?

Popular in Information technology

This 2 page Class Notes was uploaded by Ahmed Notetaker on Thursday September 22, 2016. The Class Notes belongs to 210 at Minnesota State University - Mankato taught by Salivia, Guarionex in Fall 2016. Since its upload, it has received 6 views. For similar materials see Fundamentals of Programming in Information technology at Minnesota State University - Mankato.

×

Reviews for IT 210

×

×

What is Karma?

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/22/16
WEEK 3 (FRIDAY) IT 210 def scramble2EncryptV2(plainText:str):     string1 = ''     string2 = ''     flag = True     for char in plainText:         if flag:             string1 += char         else:             string2 += char         flag = not flag     return string1 + string2 #message = input("Please enter a message: ")# "Beam me up Scotty" #cipherText = scramble2EncryptV2(message) #print(cipherText) def scramble2Decrypt(cipherText):     cipher1 = cipherText[:len(cipherText)//2]     cipher2 = cipherText[len(cipherText)//2:]     middle = ''     if len(cipherText) % 2:  # lenght of cipherText is odd         middle = cipherText[len(cipherText) // 2]         cipher2 = cipher2[1:]     plainText = ''     for i in range(len(cipher1)):         plainText += cipher1[i] + cipher2[i]     plainText += middle     return plainText #plainText = scramble2Decrypt(cipherText) #print(plainText) #Substitution (Ceasar) Cipher from string import ascii_uppercase as alphabet alphabet += ' ' my_key = 'amndefghijop qxyzrsbckltuvw' def caesarCipher(plainText, key='amndefghijop qxyzrsbckltuvw'):     message = plainText.upper()     cipher = ''     for ch in message:         idx = alphabet.find(ch) # find returns the first occurrence of ch in alphabet         cipher += key[idx]     return cipher.upper() message = "Bomb Yak" #cipherText = caesarCipher(message) #cipherText = caesarCipher(message, key='NOPQRSTUVWXYZ ABCDEFGHIJKLM') #print(cipherText) #KEY GENERATOR #IDEA: randomize the alphabet import random # def keyGen(alphabet): #     key = '' # #     for i in range(len(alphabet)):  #iterate through the indeces #         #select a random index #         idx = random.randint(0, len(alphabet) ­ 1) # #         if not alphabet[idx] in key: #             key += alphabet[idx] # #     return key def keyGen(alphabet):     key = ''     while len(key) < len(alphabet):         #select a random index         idx = random.randint(0, len(alphabet) ­ 1)         if not alphabet[idx] in key:             key += alphabet[idx]     return key #key = keyGen(alphabet) #print(key) #print(len(key)) #TEST CAESAR CIPHER WITH KEY GENERATOR key_ = keyGen(alphabet) cipherText = caesarCipher(message, key=key_) print("Key: ".rjust(20) + key_) print("Encrypted Message: ".rjust(20) + cipherText) print("Original Message: ".rjust(20))

×

25 Karma

×

×

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over \$600 per month. I LOVE StudySoup!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!
×

Refund Policy

STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com