Giter VIP home page Giter VIP logo

ec-offsec-sp2022's Introduction

Extra Credit for Offsec - crypto challenge

Leaked RSA

GOAL: Use rsa_encrypt.py output to decrypt the ciphertext.

rsa_encrypt.py:

from Cryptodome.Util.number import *

p = getPrime(1024)
q = getPrime(1024)

N = p * q
e = 65537

f = (p+q) * q + 1

phi = (p-1) * (q-1)

c = pow(bytes_to_long(b'flag{??????????????????????}'), e, N)

print("N: ",N)
print("f: ",f)
print("C: ",C)

out.txt:

N:  16869774719794592796016645140992091102472453147801739625108640767061987401578359729334758186700002920695794615867758269263067935245815900887581411745723962854888371564215602530375676233702110821497475916192581061644007358952863072245068298515075072424021478784750114727896239493022406455510901034838794780846955041384649687667718148793527692993508809054519490435975056677714747266543026662679537827403928034559455790054870489241578414220589572605564770520592869472024287643061816460327352516707212685298381200802508127133445426211901597995008131405463748729372463979778492332588002100785771535067459377985407765109759
f:  28794471208737220397452315068798074332464844306538514127322067483349208672437997254597091723737290922329987187197234895600664338357331142521912903626573300953288008655991095476077462807723107088192379967452382130165648448962024277838867910976930559005512825318857812863479899296181270190395077730653383252130287473738709820546278566058573529984185673505388050766657367606715757679903329413980966596508638162201152270800606926997006576165122469532895219829111192481211633871660223974839441921135060710538374632374024494526485576373055456186001102465334712461320523816446951732958815225803376142411726044988693340495681
C:  1371386897082421619315922850273607223364969244719522626376806848234353654447403104572133531617795563509509217034375700458296591559278797128892437978064981657690100178681239975479786050077657949653943738729402795341863173270426202887521341775543331524226349605020295064215132566519394533879034504732200137234865656201083418115985149892523287215009139613046328689461510721625880031578182620740402021117286958628622461830010173167148520830659353434522579198476975381566462445751671997947740299339347220808116370041640023815471850121217970557068256755145418998781525256662131332596654514420718569293830033494212203190452

ec-offsec-sp2022's People

Contributors

jayala-29 avatar

Watchers

 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.