This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Crypto.PublicKey import RSA | |
| from Crypto.Cipher import PKCS1_OAEP | |
| import base64 | |
| def encrypt(): | |
| keyfile = input("Public key file: ") | |
| with open(keyfile, "r") as file: | |
| data = file.read() | |
| public_key = RSA.import_key(data) | |
| cleartext = input("Cleartext: ").encode() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Crypto.Cipher import AES | |
| from Crypto.Random import get_random_bytes | |
| from Crypto.Util.Padding import pad, unpad | |
| import base64 | |
| key = input("Key: ").encode() | |
| def encrypt(): | |
| iv = get_random_bytes(AES.block_size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ciphertext = input("Ciphertext: ") | |
| m = int(input("m: ")) | |
| d = int(input("D: ")) | |
| num_digits = len(str(m)) | |
| cleartext = "" | |
| print("Decrypting (may take a while)...") | |
| for i in range(0, len(ciphertext), num_digits): | |
| num = int(ciphertext[i:i+num_digits]) | |
| cleartext += chr((num ** d) % m) | |
| print() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends KinematicBody2D | |
| enum {IDLE, RUN, JUMP, HURT, DEAD} | |
| var state | |
| var anim | |
| var new_anim | |
| var run_speed = 150 | |
| var jump_speed = -320 | |
| var gravity = 750 | |
| var velocity = Vector2.ZERO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gist.github.com/cbscribe | |
| # To install pygame, open command prompt: | |
| # pip install pygame | |
| import pygame | |
| import random | |
| WIDTH = 800 | |
| HEIGHT = 600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gist.github.com/cbscribe | |
| import pygame | |
| import random | |
| WIDTH = 800 | |
| HEIGHT = 640 | |
| FPS = 60 | |
| RUN_SPEED = 11 | |
| GRAVITY = 2 | |
| JUMP_SPEED = -31 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| import random | |
| WIDTH = 800 | |
| HEIGHT = 600 | |
| FPS = 60 | |
| pygame.init() | |
| screen = pygame.display.set_mode((WIDTH, HEIGHT)) | |
| clock = pygame.time.Clock() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>hello title</title> | |
| <link href="style.css" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <h1>Section 1</h1> | |
| <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Natoque penatibus et magnis dis parturient montes nascetur. Facilisi cras fermentum odio eu. At risus viverra adipiscing at in. Ac orci phasellus egestas tellus rutrum tellus pellentesque eu tincidunt. Blandit massa enim nec dui nunc mattis enim ut. Augue ut lectus arcu bibendum at varius vel. At augue eget arcu dictum varius duis. Duis ultricies lacus sed turpis. At augue eget arcu dictum. Egestas maecenas pharetra convallis posuere morbi leo urna molestie. Pretium vulputate sapien nec sagittis aliquam. Mattis nunc sed blandit libero volutpat sed cras ornare. Sit amet mattis vulputate enim. Eget nulla facilisi etiam dignissim diam quis enim lobortis scelerisque. Urna id volutpat lacus laoreet non cura |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Mr. Bradfield's Classes</title> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
| <!--navigation bar--> | |
| <ul class="nav"> | |
| <li class="nav"><a href="index.html">Home</a></li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def count_letters(text): | |
| # TODO: Count the number of letters | |
| num_letters = 0 | |
| print(num_letters, "letter(s)") | |
| return num_letters | |
| def count_words(text): | |
| # TODO: Count the number of words | |
| num_words = 0 |