Code Monkey home page Code Monkey logo

gittutorial's Introduction

Git Tutorial

RSA entcryption/decryption that reads and writes into a file. This task will be written in Python.

Clone this project for group A & B

use the command

git clone [email protected]:RefugeesCodeAT/gittutorial.git

Group A

git checkout encryption

After that you should be able to see the encrypt_and_write method in mycrypto.py. This method requires three parameters, namely message, keyname and write_to. Your task is to implement the encryption using RSA. Therefore you have to load the public key of your partner and encrypt the given message with this key. Your partner should be able to read this message with his/her private key. To implement this task you have to do the following steps. (feel free to change the markdown) if you completed the steps.

  • load the public key as a string from filename. Hint: use myfile
  • convert string into RSA key. Hint: use RSA.importKey()-Method
  • encode the message as 'utf-8'. Therefore look at the string API
  • encrypt the message
  • write the encrypted text to a file: Hint: use myfile. To use this method you have to convert the encrypted text to a string.
  • commit your task and push it

Testing

Go to commandline and enter

phyton

There you should see the python shell starting with >>>

>>> from crypto.test import test
>>> test.test()

To exit the shell press Ctrl+D


Merging

First you need to find a partner from the other team. You don't want to work on my github branch so we are going to change the origin to one of you. For this task go together with your partner and choose one notebook. You can see your current remotes (origin in our case) with following command:

git remote -v

Change it to your partners IP-address and then check again.

git remote set-url origin ssh://

There you have to change into the master branch:

git checkout master

We want to merge both branches (encryption and decryption) into master. After that we want to push our code so your partner can use your code.

git merge encryption
git merge decryption
git commit -m "merge encryption and decryption into master"
git push

Go to the other notebook and checkout the updated master:

git checkout master
git pull

If you enter git log you should see the commits of your partner and if you run the test both test cases should execute.

gittutorial's People

Contributors

heholord avatar fozatkardouh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.