Skip to content

Instantly share code, notes, and snippets.

View sublime247's full-sized avatar

Kushimo Bashir sublime247

View GitHub Profile
// implementing elgamle encryprion algorithm
// Alice------------Bob
// Bob share his public key to alice, alice then encrypt message with that key to bob, bob can then now decrypt the message
// Bob chooses a relatively large prime number P and g, which are publicly known
// Bob select a private key from a set of prime numbers {2,3 ......p-2}
// Bob computes his public key, using g^pr modP, where pr is his private key
// Alice compute an ephemeral key choosing a ny random prime number then doing g^i modP
// Alice compute the masking key by using bob pubKey with the random number he selected B^i modp
// Alice then encrypt the message Y= XKm modp, he then send Y(encrypted message) and Ephemeral Key to Bod
// Bob then compute his masking key by doing ke^pr mod P he can then now decrypt the message by doing X=Ykm^-1 mod P.
// implementing Diffie-Hellman Encryption Algorithm
// Alice---------Bob
// Alice has a private key a=17
// Bob has a private key b = 19
// they both agree on a relative large prime number = primitive value P= 23 and G=5 avalaible publicly
// to compute alice pubic key 5^a modp
// to compute bob pubic key 5^b modp
// they both exchange thier public key to decrypt message accross the channel
// for alice to decrypt the message she takes the public key of bob B^a mod p
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.24;
import {Test, console, console2} from "forge-std/Test.sol";
import {ChallengeTwo} from "../src/ChallengeTwo.sol";
contract MalTest is Test {
ChallengeTwo challenge;
uint8 public counter = 0;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "./one.sol";
contract Attacker {
VIP_Bank public targetBank;
address public owner;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// Write a StudentPortal smart contract where only the owner can register students into the smart contract.
// Only the owner can update and delete students records.
// Write other functions that will return students records
@sublime247
sublime247 / main.dart
Created December 30, 2022 00:17
debbuging_assignment
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(
MyApp());
}
class MyApp extends StatelessWidget {
@override
@sublime247
sublime247 / main.dart
Created December 30, 2022 00:13
debbuging_assignment
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@sublime247
sublime247 / main.dart
Created December 30, 2022 00:13
debbuging_assignment
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@sublime247
sublime247 / main.dart
Created December 28, 2022 22:57
magenta-glacier-4501
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
import 'dart:math';
void main() {
print('Circle1:');
Circle circle1 = Circle.circle1();
circle1.getArea(1);
circle1.getCircumference(1);
circle1.getDescription('1', 'red');
circle1.getColor('red');
print('');