This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 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. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 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 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 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; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // SPDX-License-Identifier: MIT | |
| pragma solidity 0.8.19; | |
| import "./one.sol"; | |
| contract Attacker { | |
| VIP_Bank public targetBank; | |
| address public owner; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 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 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import 'package:flutter/material.dart'; | |
| import 'package:provider/provider.dart'; | |
| void main() { | |
| runApp( | |
| MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import 'package:flutter/material.dart'; | |
| import 'package:provider/provider.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import 'package:flutter/material.dart'; | |
| import 'package:provider/provider.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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(''); | 
NewerOlder