Skip to content

Instantly share code, notes, and snippets.

#include "graphics.h"
int main( )
{
initwindow(400, 300, "First Sample");
while (!kbhit())
{
cleardevice();
circle(mousex(), mousey(), 40);
delay(16);
export PATH=$PATH:/usr/local/go/bin
export PATH="$HOME/.cargo/bin:$PATH"
ssh-add -K /Users/edin-m/.ssh/bitbucket_shoppertrak_rsa
@edin-m
edin-m / README.md
Last active January 24, 2021 10:54
php openssl rsa encription decryption signature with Crypto++ C++ verification

USE CASE:

  • encrypt something with a C++ application using server's public key and send to a PHP application
  • PHP application can decrypt it using a private key
  • PHP application sends a cleartext response with a signature
  • C++ application verifies the message using the signature

Gist of it: among others, there are PKSC1v15 and PSS (Probabilistic Signature Scheme) en/decryption and signature schemes Wiki quote: " In general, RSA-PSS should be used as a replacement for RSA-PKCS#1 v1.5. "

PHP has OpenSSL out of box and for en/decryption it supports OPENSSL_PKCS1_OAEP_PADDING which is PKCS1 with SHA1

@edin-m
edin-m / app.cpp
Last active January 24, 2021 10:33
RSA signing between PHP and C++ using phpseclib and Crypto++ and PSS and SHA256
// use https://github.com/noloader/cryptopp-pem to add pem loading capabilities to Crypto++
// On Windows those must be manually added to the project and compiled
void readKeys( << INPUTS >> ) {
RSA::PrivateKey privateKey;
RSA::PublicKey publicKey;
qDebug() << "Loading pub/priv key from file";
FileSource privatefs("C:\\del\\dpimkey2", true);
//http://www.youtube.com/user/thecplusplusguy
//The Box2D main program with SDL
#include <iostream>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
@edin-m
edin-m / build.gradle
Created November 29, 2019 22:00
Aggregated Jacoco reports in a multi-project Gradle build
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
repositories {
jcenter()
}
jacoco {
toolVersion = '0.7.1.201405082137'
@edin-m
edin-m / docker-shared-nw.md
Created July 20, 2019 16:12 — forked from kojiwell/docker-shared-nw.md
This is how to create a bridge between Docker containers and outside and create containers with the IP addresses you want to assign.

Docker - Create a Bridge and Shared Network

Sometimes I want to use Docker containers like regular VMs, creating a bridge on a Docker host, having containers on the same subnet with IP addresses I want to assign, and then logging into them via port 22. (No port forwarding, please.) So here's how to do it.

On this example, I use Vagrant and VirtualBox on my MacBook and create containers with IP addresses shown on the table below. Once you go through these steps, you should be able to extend the idea into your on-premises network.

@edin-m
edin-m / index.html
Last active November 12, 2018 20:02
Boardgame
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
@edin-m
edin-m / index.html
Last active October 19, 2018 22:48
L-Systems
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<canvas id="canvas" width="600" height="600" style="border: 1px solid black"></canvas>
<script src="index.js"></script>
@edin-m
edin-m / .gitignore
Last active September 12, 2016 20:19
MoEE zavrsni rad
node_modules