This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Security.addProvider(new BouncyCastleProvider()); | |
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("ECGOST3410", "BC"); | |
keyPairGenerator.initialize(new ECGenParameterSpec( "GostR3410-2001-CryptoPro-A" )); | |
// keyPairGenerator.initialize(new ECGenParameterSpec("Tc26-Gost-3410-12-256-paramSetA")); | |
KeyPair keyPair = keyPairGenerator.generateKeyPair(); | |
X500Name issuerName = new X500Name("CN=127.0.0.1, O=FOO, L=BAR, ST=BAZ, C=QUX"); | |
X500Name subjectName = issuerName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
coreos: | |
etcd2: | |
discovery: https://discovery.etcd.io/0702af55dc089054356c4429204b6a13 | |
# advertise-client-urls: "http://$public_ipv4:2379" | |
# initial-advertise-peer-urls: "http://$private_ipv4:2380" | |
# listen-client-urls: "http://0.0.0.0:2379" | |
# listen-peer-urls: "http://$private_ipv4:2380" | |
units: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0. Алфавиты, грамматики, языки, иерархия Хомского | |
1. Символы | |
2. Метасимволы . ^ $ * + ? { [ ] \ | ( ) | |
3. Метасимвол диапазон [abc], [a-c], [akm$], [^z] | |
4. Экранирование и спецпоследовательности \ | |
5. Распространенные спецпоследовательности \d \D \s \S \w \W | |
6. Повторение * | |
7. Примеры простых комбинаций a[bcd]*b | |
8. Повторение + | |
9. Повторение ? (0 или 1 раз) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Cryptography.Pkcs; | |
using System.Security.Cryptography.X509Certificates; | |
namespace EncryptDecrypt | |
{ | |
class Program | |
{ | |
private static X509Certificate2 LoadCert(string thumbprint) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using iTextSharp.text; | |
using iTextSharp.text.pdf; | |
using iTextSharp.text.pdf.security; | |
using NUnit.Framework; | |
using Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Pkcs; | |
using Org.BouncyCastle.Security; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Proxy use parser BeautifulSoup for extracting strings. | |
# Correctly replace in http-links and other tags (urls | |
# and other attrs are not botched). | |
# Does not handle situations like this: | |
# <b>Py</b><font color="red">thon</font> | |
# Hyphen assumed as separator of words |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально (порт на ваше | |
# усмотрение), который показывает содержимое страниц Хабра. С одним исключением: после | |
# каждого слова из шести букв должен стоять значок «™». Примерно так: | |
# | |
# http://habrahabr.ru/company/yandex/blog/258673/ | |
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают проблемы и | |
# особенности TLS. Я хочу воспользоваться этой возможностью, чтобы поговорить об одной из | |
# них, а именно — о настройке ciphersiutes. | |
# |