Skip to content

Instantly share code, notes, and snippets.

View vakho10's full-sized avatar

Vakho vakho10

  • Georgia/Tbilisi
View GitHub Profile
package studio.safe.spring.resttemplate;
import java.io.File;
import java.io.IOException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@nielsutrecht
nielsutrecht / RsaExample.java
Created December 28, 2016 14:13
Example of RSA generation, sign, verify, encryption, decryption and keystores in Java
import javax.crypto.Cipher;
import java.io.InputStream;
import java.security.*;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class RsaExample {
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
/* BIN2ISO (C) 2000 by DeXT
This is a very simple utility to convert a BIN image
(either RAW/2352 or Mode2/2336 format) to standard ISO format (2048 b/s).
Structure of images are as follows:
Mode 1 (2352): Sync (12), Address (3), Mode (1), Data (2048), ECC (288)
Mode 2 (2352): Sync (12), Address (3), Mode (1), Subheader (8), Data (2048), ECC (280)
Mode 2 (2336): Subheader (8), Data (2048), ECC (280)
Mode 2 / 2336 is the same as Mode 2 / 2352 but without header (sync+addr+mode)