G14p

@Giapppp

“Discipline is the bridge between goals and accomplishment.” – Jim Rohn

Joined on May 3, 2023

  • Ethernaut Reentrancy // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "openzeppelin-contracts-06/math/SafeMath.sol"; contract Reentrance { using SafeMath for uint256;
     Like  Bookmark
  • Introduction In August 13th, 2024, NIST announced three post-quantum cryptography standards, where two of them are from lattice-based cryptography and the other one is from hash-based cryptography. In this post, we will have an overview about FIPS 203, which specify algorithms derived from CRYSTALS-Kyber, is a key encapsulation mechanism based on module lattice. Notation Pre-requisited The LWE Problem Definition The Learning with Errors Problem (LWE) has an important role in many cryptographic schemes that are related to lattice cryptography, so let's review this problem again. Definition 1. For positive integer $m, n, q$ and $\beta < q$, the $LWE_{n, m, q, \beta}$ problem asks to distinguish between the following two distributions:
     Like  Bookmark
  • Introduction Yao's Garbled Circuit is a cryptographic protocol that enables two-party secure computation in which two mistrusting parties can jointly evaluate a function over their private inputs without the presence of a trusted third party. The invention of garbled circuit was credited to Andrew Yao, as Yao introduced the idea in [FOCS'86]. The first written document about thus technique was by Goldreich, Micali and Wigderson in [STOC'87]. Yao's protocol solving Yao's Millionaires' Problem [IEEE'82] was the beginning example of secure computation, yet it's not directly relate to garbled circuit. Background Boolean Circuits A Boolean circuit is a mathematical model for combinational digital logic circuits. Boolean circuits are defined in terms of the logic gates they contain. For example, a circuit might contain binary AND and OR gates and unary NOT gates, or be entirely described by binary NAND gates. Each gate corresponds to some Boolean function that takes a fixed number of bits as input and outputs a single bit.
     Like  Bookmark
  • Decrypt Message 2 Open file with IDA image Program will generate ascii random key, and length of key will divide by 5. Then program converts flag and key into arrays, xor them together with modulo 5. image After xoring, we are given encrypt flag, but with shuffled index (v14 is the index array)
     Like  Bookmark
  • Square Attack là một kĩ thuật tấn công đối với Block Cipher khi khai thác vào các tính chất không đổi của các round encryption trong cipher đó. Kĩ thuật này được phát hiện lần đầu tiên đối với Square Cipher. Trong bài viết này, mình sẽ tập trung vào việc khai thác AES 4 round và giải một số bài liên quan đến kĩ thuật này. Ngoài ra, ta cũng sẽ thảo luận về áp dụng Square Attack cho 5 round AES Tài liệu https://www.davidwong.fr/blockbreakers/square.html Chi tiết AES 3 round Kí hiệu $\varLambda$-set là tập hợp các bytearray phân biệt có độ dài 16 và khác nhau tại vị trí idx, được gọi là active index. Các active index này sẽ nhận toàn bộ các giá trị từ 0 đến 255 trong $\varLambda$-set. Lưu ý rằng $\varLambda$-set có thể có nhiều active index Xét trường hợp $\varLambda$-set của chúng ta chỉ có 1 active index, giả sử idx = 0, ta sẽ phân tích output của từng phần tử khi trải qua các bước trong AES, gồm SubBytes, ShiftRows, MixColumns và AddRoundKey
     Like  Bookmark
  • I played HTB University CTF 2023 with my university team @Wanna.W1n and my team solved all crypto challenges. Here is my writeup for two challenges I solved: Mayday Mayday and Zombie Rolled Mayday Mayday After successfully obtaining the research papers by extracting the encryption key, a new obstacle arises. The essential information regarding potential cures, including formulas and test results, is shielded by another layer of encryption. Can you overcome this additional challenge to reveal the final formula, enabling you to initiate the cure creation process? source.py from Crypto.Util.number import getPrime, GCD, bytes_to_long from secret import FLAG from random import randint
     Like 2 Bookmark
  • Symmetric Cipher Mã hóa đối xứng chỉ sử dụng duy nhất 1 khóa bí mật (secret key) để mã hóa hoặc giải mã văn bản. Vì thế nên câu hỏi đặt ra là làm sao để chia sẻ khóa đó cho các bên một cách toàn vẹn. image Các loại mã hóa đối xứng hiện nay đều có thể được chia ra thành 2 loại cơ bản là:Mã hóa dòng (Stream cipher) Mã hóa khối (Block cipher) Stream Cipher Mã hóa dòng là loại mã hóa/giải mã văn bản của bạn bằng một khóa có độ dài ngang bằng với văn bản. Khi đã mã hóa một bản rõ với một khóa nào đó, bắt buộc không được sử dụng lại khóa đó để mã hóa cho bản rõ khác. Bởi vì, hàm XOR ($\oplus$) có tính chất nghịch đảo $A \oplus B = C <=> A \oplus C = B$. Cho nên nếu ta sử dụng lặp lại key thì attacker hoàn toàn có thể đoán được gần đúng các bản rõ ban đầu bằng việc XOR các bản mã với nhau như bên dưới.
     Like 3 Bookmark
  • Students: Vũ Tiến Giáp - 22520367 Nguyễn Viết Duy - 22520336 Lecturer: Nguyễn Ngọc Tự Overview In the ever-evolving landscape of technology, the government agency recognizes the imperative to fortify its communication infrastructure against the looming threat of quantum advancements. As quantum computers inch closer to reality, the conventional cryptographic protocols currently safeguarding sensitive governmental information become susceptible to rapid decryption. In response to this imminent challenge, the agency contemplates the adoption of lattice-based cryptographic algorithms for post-quantum secure communications.
     Like 5 Bookmark
  • I played WannaGame Championship 2023 with my team @1337%_Yogurt and ended up with 8th place. To get a better rank in next year, I should learn more :((. Here is my writeup for 2 challenges i solved in the competition: cossin and ezcurve Cossin In this challenge, we have ans = sin(flag)*cos(flag) and ans has 1337 bits after decimal point. With a little trigonometry, we will have: $$2flag + small_number = arcsin(2ans) + k2\pi$$ (We have $small_number$ due to floating-point) Now, we can use LLL to find flag with this basis: $$\begin{bmatrix} \arcsin(2*ans) & 0 & 1 \ -1 & 1 & 0 \ \pi & 0 & 0\end{bmatrix}$$ and we should have a vector $v = (small_number, 2 * flag, 1)$
     Like 2 Bookmark
  • This is my note about Isogeny-Based Cryptography, I really want to make a CTF challenge about isogeny, but I don't understand enough to make it :(. Maybe someday I can do it <3 My note: https://giapppp.notion.site/giapppp/Isogeny-based-cryptography-aec3e90af4d14ca1a3db8be7ffd0794a
     Like 2 Bookmark
  • Last week, I played Hack The Boo with my team @phis1Ng__. I solved all crypto challenges include 3 in Hack The Boo - Practice, and 2 in Hack The Boo - Competition. All challenges are not too hard but not too easy, so I decided to write a writeup for all of them. Hack The Boo - Practice 1. Hexoding64 chall.py from secret import FLAG HEX_CHARS = '0123456789abcdef' B64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
     Like 3 Bookmark
  • Tuần vừa rồi, mình có chơi giải Bauhinia CTF với team @phis1Ng_. Mình thấy các challenge Crypto được đánh giá cao, với lại nhạc cũng hay nữa :))), mình có làm được một vài challenge về Crypto nên muốn chia sẻ với mọi người grhkm's babyRSA chall.py from math import gcd from Crypto.Util.number import getPrime, getRandomNBitInteger, bytes_to_long from secret import flag lcm = lambda u, v: u*v//gcd(u, v)
     Like 2 Bookmark
  • Tuần vừa rồi, mình có chơi giải CryptoCTF 2023 với team @Wanna.W1n. Đúng như cái tên, giải này toàn Crypto không à :)). Sau đây là lời giải của một vài bài mà mình osint làm được. Derik Detective Derik possessed an uncanny ability to unravel complex puzzles, his razor-sharp mind weaving through the intricate threads of mystery with effortless precision derik.py #!/usr/bin/env python3 from Crypto.Util.number import *
     Like 1 Bookmark
  • Mình xin trình bày một số bài mà mình làm được trong minictf tối 22/7 vừa qua Flipping Login server.py #!/usr/bin/env python3 import json import os import signal
     Like 1 Bookmark
  • Lời giải của mình cho một số bài Cryptography trong giải SEETF 2023 BabyRC4 I have a simple RC4 encryption oracle. Shouldn't be that hard to break...right? from Crypto.Cipher import ARC4 from os import urandom key = urandom(16) flag = b'SEE{?????????????????????????????????}'[::-1]
     Like 1 Bookmark
  • TL; DR: We can generate smooth-prime p and choose q = 3; and then solve the d-log problem to find e: $$ msg^e = s \ (mod\ p * q) $$ Keysmith I lost my key... can you find it? nc tjc.tf 31103 Category: Cryptography 1. First glance
     Like 2 Bookmark
  • Đây là challenge mình cảm thấy thú vị nhất trong những challenge mình giải được trong giải này (mấy bài khó hơn thì mình giải không được :D), vì thế mình muốn viết writeup chi tiết cho bài này, vì vốn Tiếng Anh hạn hẹp mà mình lại nhiều lời nên mình sẽ viết Tiếng Việt vậy :D Perfect Synchronization The final stage of your initialization sequence is mastering cutting-edge technology tools that can be life-changing. One of these tools is quipqiup, an automated tool for frequency analysis and breaking substitution ciphers. This is the ultimate challenge, simulating the use of AES encryption to protect a message. Can you break it? Category: Cryptography public files Writeup
     Like 3 Bookmark