Skip to content

Instantly share code, notes, and snippets.

View ElMostafaIdrassi's full-sized avatar

El Mostafa Idrassi ElMostafaIdrassi

View GitHub Profile
@ElMostafaIdrassi
ElMostafaIdrassi / encrypt_openssl.md
Created January 10, 2020 14:13 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@ElMostafaIdrassi
ElMostafaIdrassi / windows_hardening.cmd
Created May 10, 2020 13:46 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
::
::#######################################################################
::
:: Change file associations to protect against common ransomware
@ElMostafaIdrassi
ElMostafaIdrassi / readwrite.go
Created September 1, 2020 14:39 — forked from tomcatzh/readwrite.go
Golang readline and writeline
func readLines(path string) ([]string, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
var lines []string
scanner := bufio.NewScanner(file)
for scanner.Scan() {
@ElMostafaIdrassi
ElMostafaIdrassi / auth.go
Created October 7, 2020 19:05 — forked from ogazitt/auth.go
Auth0 PKCE flow for a CLI built in golang
package auth
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
@ElMostafaIdrassi
ElMostafaIdrassi / golang-tls.md
Created August 5, 2021 15:53 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@ElMostafaIdrassi
ElMostafaIdrassi / rfc3161.txt
Created March 21, 2022 11:57 — forked from Manouchehri/rfc3161.txt
List of free rfc3161 servers.
http://timestamp.digicert.com
http://timestamp.globalsign.com/tsa/r6advanced1
http://rfc3161timestamp.globalsign.com/advanced
http://timestamp.sectigo.com
http://timestamp.apple.com/ts01
http://tsa.mesign.com
http://time.certum.pl
https://freetsa.org
http://timestamp.globalsign.com/scripts/timstamp.dll
http://timestamp.globalsign.com/?signature=sha2
@ElMostafaIdrassi
ElMostafaIdrassi / cgo.md
Created October 6, 2022 12:01 — forked from zchee/cgo.md
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.