Skip to content

Instantly share code, notes, and snippets.

View psnehanshu's full-sized avatar
👨‍💻
Building stuff

স্নেহাংশু ফুকন psnehanshu

👨‍💻
Building stuff
View GitHub Profile
@psnehanshu
psnehanshu / encryption.go
Created October 31, 2024 19:07
AES encryption implementation in Golang
package encryption
import (
"fmt"
"math"
)
// Rijndael S-box as a 256-byte array
var sBox = [256]byte{
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
@psnehanshu
psnehanshu / array.c
Last active October 24, 2018 10:59
To be submitted on 27 sep
#include <stdio.h>
// Inserts an element. Returns the number of new elements.
int insert(int arr[], int len, int num, int key)
{
int i;
if (len == key)
{
arr[key] = num;