Skip to content

Instantly share code, notes, and snippets.

View MooneDrJune's full-sized avatar
:octocat:
Enchanting Technology

DrJuneMoone MooneDrJune

:octocat:
Enchanting Technology
View GitHub Profile
@MooneDrJune
MooneDrJune / BSM_WithAdjoints.py
Created July 27, 2024 14:53 — forked from jace48/OptionPremium_WithGreeks.py
Black Scholes Merton with Greeks (Adjoints) with respect to Inputs
import math
from scipy.stats import norm
def BSM_withAdjoints(S0, r, y, sig, K, T):
#Evaluation
sqrtT = math.sqrt(T)
df = math.exp(-r * T)
@MooneDrJune
MooneDrJune / main.py
Created May 28, 2024 02:47 — forked from frizz925/main.py
AES-256-CBC w/ Base64 using PyCryptodome library
from Crypto.Cipher import AES
from Crypto.Util import Padding
from hashlib import md5
from base64 import b64encode, b64decode
import sys
passphrase = sys.argv[1]
content = sys.argv[2]
print(passphrase, content)
@MooneDrJune
MooneDrJune / encryption.php
Created May 28, 2024 02:47 — forked from eoli3n/encryption.php
Encrypt - Decrypt AES from/to Python PyCryptodome from/to PHP openssl
<?php
// use to generate key : 'openssl rand -hex 32'
function my_encrypt($data, $passphrase) {
$secret_key = hex2bin($passphrase);
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));
$encrypted_64 = openssl_encrypt($data, 'aes-256-cbc', $secret_key, 0, $iv);
$iv_64 = base64_encode($iv);
$json = new stdClass();
$json->iv = $iv_64;
@MooneDrJune
MooneDrJune / createWindowsShortcut.py
Created August 22, 2022 11:40 — forked from bitsgalore/createWindowsShortcut.py
Create Windows Desktop shortcut to executable in Python Scripts directory
#! /usr/bin/env python
import os
import sys
import shutil
import sysconfig
import winreg
from win32com.client import Dispatch
def get_reg(name,path):
# Read variable from Windows Registry