Skip to content

Instantly share code, notes, and snippets.

View shubham-kanodia's full-sized avatar
🏠
Working from home

Shubham Kanodia shubham-kanodia

🏠
Working from home
View GitHub Profile
@shubham-kanodia
shubham-kanodia / angle_finder.py
Created December 4, 2023 07:20
Script to find angle
import base64
import requests
class AngleFinder:
def __init__(self):
self.endpoint = "http://pose-tracker-load-balancer-1564941657.us-west-2.elb.amazonaws.com/yoga/angle_calculator"
def convert_image_to_base64(self, image_path):
with open(image_path, "rb") as image_file:
@shubham-kanodia
shubham-kanodia / magic_square_local_deployment.md
Created October 25, 2023 16:33
Magic Square: Local Deployment

Deployment and Execution Steps

Code:

// The 'magic_square' program.
program magic_square.aleo {
    
    // State
    // Public
@shubham-kanodia
shubham-kanodia / gist:91090217764f788274d5c18d8b7e36ff
Created March 16, 2023 07:44
What input value greater than 4294967296 and within the prime field satisfies the given equation?
pragma circom 2.1.4;
include "circomlib/circuits/comparators.circom";
template RangeProof(bits, max_abs_value) {
signal input in;
component lowerBound = LessThan(bits);
component upperBound = LessThan(bits);
pragma circom 2.1.4;
template SumArray(numOfElements) {
signal input in[numOfElements];
signal output out;
var sm = 0;
for(var i=0; i < numOfElements; i++) {
sm += in[i];

R1CS

Equation

$$x^2 + x + 2 == 32$$

Gates

  • $x * x = sym_1$
  • $x + sym_1 = sym_2$
@shubham-kanodia
shubham-kanodia / attack.sol
Created January 16, 2023 10:14
Secret number challenge
pragma solidity ^0.6.0;
contract SecretNumberAttack {
function attack(bytes32 hash) public returns (uint8) {
uint8 number;
uint8 secretNumber;
for (number = 0; number <= 256; number++) {
if (keccak256(abi.encodePacked(number)) == hash) {
secretNumber = number;
@shubham-kanodia
shubham-kanodia / dappcamp-ctf-description.md
Created November 3, 2022 03:51
Dappcamp CTF Description

This level walks you through the very basics of how to play the game. You can follow the steps below to do the setup or go through the walkthrough video to get started.

 

1. Get test ether

To play the game, you will need test ether. The easiest way to get some testnet ether is via a faucet.

Once you see some ether in your balance, move on to the next step.

 

2. Connect to Goerli network

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
contract A {
error InvalidOwnerOrNewAddress(address newOwner);
address public owner;
constructor() {
owner = msg.sender;
@shubham-kanodia
shubham-kanodia / challenge.md
Last active October 26, 2022 10:46
DappCamp NFT CTF Challenge

NFT - Capture The Flag

We have deployed an NFT contract here. There is a flag hidden in one of the NFT's metadata.

Once you find the flag, you can make a submission in this contract. You must submit your name and the flag you found.

We will announce the top three teams in the lecture!!