ssongk
ssongk
ssongk
전체 방문자
오늘
어제

공지사항

  • resources
  • 분류 전체보기 (626)
    • CTF (24)
    • background (79)
      • fuzzing (5)
      • linux (29)
      • linux kernel (15)
      • windows (2)
      • web assembly (1)
      • embedded (0)
      • web (13)
      • crypto (9)
      • mobile (1)
      • AI (1)
      • etc.. (3)
    • write-up(pwn) (171)
      • dreamhack (102)
      • pwn.college (4)
      • pwnable.xyz (51)
      • pwnable.tw (3)
      • pwnable.kr (5)
      • G04T (6)
    • write-up(rev) (32)
      • dreamhack (24)
      • reversing.kr (8)
    • write-up(web) (195)
      • dreamhack (63)
      • LOS (40)
      • webhacking.kr (69)
      • websec.fr (3)
      • wargame.kr (6)
      • webgoat (1)
      • G04T (7)
      • suninatas (6)
    • write-up(crypto) (19)
      • dreamhack (16)
      • G04T (1)
      • suninatas (2)
    • write-up(forensic) (53)
      • dreamhack (5)
      • ctf-d (47)
      • suninatas (1)
    • write-up(misc) (13)
      • dreamhack (12)
      • suninatas (1)
    • development (31)
      • Linux (14)
      • Java (13)
      • Python (1)
      • C (2)
      • TroubleShooting (1)
    • 자격증 (8)
    • 이산수학 (1)
    • 정보보안 (0)
hELLO · Designed By 정상우.
ssongk
background/crypto

[CryptoHack] Modular Inverting (모듈로 역수)

background/crypto

[CryptoHack] Modular Inverting (모듈로 역수)

2023. 7. 1. 15:22

유한한 필드 Fp 내에서 우리는 요소를 더하고, 곱하고, 항상 필드의 다른 요소를 얻을 수 있다.
필드의 모든 요소 g에 대해 g * d ≡ 1 mod p인 고유한 정수 d가 존재한다.
이것은 g의 곱셈의 역수이다.

(d = 1/g)

 

모듈로 역수의 예시는 다음과 같다.

7 * 8 = 56 ≡ 1 mod 11

 

연습 문제는 다음과 같다.
3 * d ≡ 1 mod 13

mod 13 에서 3*d = 1을 만족하는 수(모듈로 역수)를 찾으면 된다.

이는 3*d % 13 = 1을 만족함을 의미한다.

계산해보면 d는 9이다.

 

파이썬의 inverse 함수로도 구할 수 있다.

from Crypto.Util.number import inverse

print(inverse(3,13))

 


레퍼런스

https://cryptohack.org/courses/modular/mdiv/

 

CryptoHack – Home

A fun, free platform to learn about cryptography through solving challenges and cracking insecure code. Can you reach the top of the leaderboard?

cryptohack.org

https://ko.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/modular-inverses

 

모듈로 역수 (개념 이해하기) | 암호학이란? | Khan Academy

수학, 예술, 컴퓨터 프로그래밍, 경제, 물리학, 화학, 생물학, 의학, 금융, 역사 등을 무료로 학습해 보세요. 칸아카데미는 어디에서나 누구에게나 세계 최고의 무료 교육을 제공하는 미션을 가진

ko.khanacademy.org

'background > crypto' 카테고리의 다른 글

[CryptoHack] Legendre Symbol (르장드르 기호)  (0) 2023.07.04
[CryptoHack] Quadratic Residues (제곱 잉여)  (0) 2023.07.01
[CryptoHack] Modular Arithmetic 2  (0) 2023.07.01
[CryptoHack] Modular Arithmetic 1  (0) 2023.07.01
[CryptoHack] Extended GCD  (0) 2023.07.01
    'background/crypto' 카테고리의 다른 글
    • [CryptoHack] Legendre Symbol (르장드르 기호)
    • [CryptoHack] Quadratic Residues (제곱 잉여)
    • [CryptoHack] Modular Arithmetic 2
    • [CryptoHack] Modular Arithmetic 1
    ssongk
    ssongk
    벌레 사냥꾼이 되고 싶어요

    티스토리툴바

    개인정보

    • 티스토리 홈
    • 포럼
    • 로그인

    단축키

    내 블로그

    내 블로그 - 관리자 홈 전환
    Q
    Q
    새 글 쓰기
    W
    W

    블로그 게시글

    글 수정 (권한 있는 경우)
    E
    E
    댓글 영역으로 이동
    C
    C

    모든 영역

    이 페이지의 URL 복사
    S
    S
    맨 위로 이동
    T
    T
    티스토리 홈 이동
    H
    H
    단축키 안내
    Shift + /
    ⇧ + /

    * 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.