Skip to content

Instantly share code, notes, and snippets.

View azure-hu's full-sized avatar

István Zollai azure-hu

View GitHub Profile
@azure-hu
azure-hu / CryptoHelpers.cs
Created November 21, 2024 12:52
bc-xml-security Possible ECDSA Extension
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Org.BouncyCastle.Crypto.Digests;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Modes;
using Org.BouncyCastle.Crypto.Paddings;
using Org.BouncyCastle.Crypto.Signers;
using Org.BouncyCastle.Security;
@azure-hu
azure-hu / BouncyCastleCertificateGenerator.java
Created April 17, 2024 10:03 — forked from vivekkr12/BouncyCastleCertificateGenerator.java
Generate root X509Certificate, Sign a Certificate from the root certificate by generating a CSR (Certificate Signing Request) and save the certificates to a keystore using BouncyCastle 1.5x
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.BasicConstraints;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.KeyUsage;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.X509v3CertificateBuilder;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
@azure-hu
azure-hu / Ecies.cs
Created October 2, 2023 09:42 — forked from cocowalla/Ecies.cs
Simple ECIES implementation
using System;
using System.Security.Cryptography;
// ReSharper disable SuggestVarOrType_SimpleTypes - BCL rules
namespace Crypto
{
/// <summary>
/// Simple implementation of ECIES (Elliptic Curve Integrated Encryption Scheme) based on http://www.secg.org/sec1-v2.pdf, section 5.1
/// Things not implemented:
/// - Encoding parameters using compressed points; only uncompressed points are used
@azure-hu
azure-hu / ECDH.kt
Created April 26, 2023 13:14 — forked from sorokod/ECDH.kt
Generate a shared secret key between two parties using ECDH
package crypto
import java.security.*
import java.security.spec.X509EncodedKeySpec
import java.util.*
import javax.crypto.KeyAgreement
/**
* Generate a shared secret key between two parties using ECDH
*
@azure-hu
azure-hu / ECIESExample.java
Created April 4, 2023 08:16 — forked from amrishodiq/ECIESExample.java
An example of how to use ECIES encryption.
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.SecureRandom;
import java.security.Signature;
import java.security.SignatureException;
import java.security.spec.ECGenParameterSpec;
import javax.crypto.Cipher;
import org.bouncycastle.jce.spec.IEKeySpec;
import org.bouncycastle.jce.spec.IESParameterSpec;
@azure-hu
azure-hu / README.md
Created July 16, 2022 08:46 — forked from revant/README.md
Arch Linux on Lenovo IdeaPad 330-15ARR

Required Kernel params

loglevel=3 iommu=pt acpi_backlight=native
  • iommu=pt Solves sudden freeze of graphics Arch Forum Link
  • acpi_backlight=native Solves back light "failed" message during boot Arch Wiki
  • Use it with other params e.g. loglevel=3 iommu=pt acpi_backlight=native apparmor=1 security=apparmor quiet
@azure-hu
azure-hu / AbstractPdfSigner.cs
Last active December 2, 2021 11:49
Classes for signing PDF files.
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.security;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Security;
using Security.Cryptography;
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
@azure-hu
azure-hu / install-rtl-sdr.sh
Created January 19, 2021 16:48 — forked from bilson/install-rtl-sdr.sh
Install script for rtl-sdr in raspberry pi
#!/bin/bash
cd ~
sudo apt-get update
sudo apt-get install -y git cmake libusb-1.0-0.dev build-essential
cat <<EOF >no-rtl.conf
blacklist dvb_core
blacklist dvb_usb_rtl28xxu
@azure-hu
azure-hu / gist:eb93fc105b64985cb2bc12f327b0355a
Created November 25, 2020 08:28 — forked from Mikodes/gist:be9b9ce42e46c3d4ccb6
All Media queries for resolutions
/* (320x480) iPhone (Original, 3G, 3GS) */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
/* insert styles here */
}
/* (320x480) Smartphone, Portrait */
@media only screen and (device-width: 320px) and (orientation: portrait) {
/* insert styles here */
}