Skip to content

Instantly share code, notes, and snippets.

@kek-Sec
kek-Sec / RSA.cs
Created May 18, 2017 20:56
RSA c# utility class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Security.Cryptography;
class RSA
{
@kek-Sec
kek-Sec / SysRestoreDelete.cs
Created July 1, 2017 11:00
C# Find and Delete system restore points
using System.Management;
using System.Runtime.InteropServices;
[DllImport("Srclient.dll")]
public static extern int DeleteRestorePoint(int index);
private void SearchAndDestroySystemRestore()
{
//Find sequence numbers of system restore points
@kek-Sec
kek-Sec / base64decode.ts
Created November 14, 2020 17:48
Typescript base64 to ascii String
export class base64decode{
private PADCHAR: string = '=';
private ALPHA: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
private getByte(s: string, i: number): number {
const x = s.charCodeAt(i);
return x;
}
private getByte64(s: string, i: number): number {
@kek-Sec
kek-Sec / RSA.java
Created November 25, 2020 14:58
BouncyCastle RSA Java
package tp4768;
import java.security.SecureRandom;
import java.security.Security;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.MessageDigest;
package Game;
import Interfaces.SolverInterface;
public class SudokuSolver implements SolverInterface{
// the final boolean we return
public boolean isCorrect;
//number of squares in the puzzle
@kek-Sec
kek-Sec / tsconfig.json
Created May 27, 2021 10:51
tsconfig.json optimized compiler settings
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictPropertyInitialization": false,
"noImplicitAny": false,
"noImplicitReturns": true,
@kek-Sec
kek-Sec / dict.ts
Created June 10, 2021 09:24
Typescript dictionaries - symbols - numbers - uppercase - lowercase
let symbols_dict:Array<string> = ['!','@','#','$','%','^','&','*','(',')','_','-','=','+','<','>',':','~',']','['];
let numbers_dict:Array<string> = ['1','2','3','4','5','6','7','8','9','0'];
let lowercase_dict:Array<string> = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z'];
let uppercase_dict:Array<string> = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z'];
@kek-Sec
kek-Sec / user.js
Created June 15, 2021 07:42
Moongoose JWT model
var mongoose = require('mongoose');
var uniqueValidator = require('mongoose-unique-validator');
var crypto = require('crypto');
var jwt = require('jsonwebtoken');
var secret = require('../config').secret;
var UserSchema = new mongoose.Schema({
username:
{
@kek-Sec
kek-Sec / Progam.cs
Created August 2, 2021 09:40
eretailcontent image script
static void Main(string[] args)
{
List<String> ids = new List<String>();
List<String> imgs = new List<String>();
Console.WriteLine("Dir -> ");
var image_folder = Console.ReadLine();
string[] files = Directory.GetFiles(image_folder,"*", SearchOption.AllDirectories);
foreach(string s in files)
@kek-Sec
kek-Sec / style.scss
Created August 3, 2021 07:23
Angular 12 full height gradient background
.bg {
background-color: #4158d0;
background-image: linear-gradient(43deg, #4158d0 0%, #c850c0 46%, #ffcc70 100%);
/* Full height */
height: 100vh;
}