This file contains hidden or 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.Runtime.InteropServices; | |
namespace TranslucentTB | |
{ | |
class Program | |
{ | |
[DllImport("user32.dll")] | |
internal static extern IntPtr SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); | |
[DllImport("user32.dll")] |
This file contains hidden or 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.Text; | |
using System.Diagnostics; | |
namespace Enigma | |
{ | |
class EnigmaMachine | |
{ | |
private const string _alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
private static Tuple<string, int, int> _rotor_Blank = new Tuple<string, int, int>("ABCDEFGHIJKLMNOPQRSTUVWXYZ", -99, -99); |
This file contains hidden or 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
def make_pi(l): | |
q, r, t, k, m, x, j = 1, 0, 1, 1, 3, 3, 0 | |
while j < l + 2: | |
if 4 * q + r - t < m * t: | |
yield m | |
j += 1 | |
q, r, t, k, m, x = 10*q, 10*(r-m*t), t, k, (10*(3*q+r))//t - 10*m, x | |
else: | |
q, r, t, k, m, x = q*k, (2*q+r)*x, t*x, k+1, (q*(7*k+2)+r*x)//(t*x), x+2 |
This file contains hidden or 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/python3.5 | |
# -*- coding: utf-8 -*- | |
""" | |
Copyright (c) 2015 James Booth | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
This file contains hidden or 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 -*- | |
""" | |
Copyright (c) 2015 James Booth | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
This file contains hidden or 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
// Compatible with .Net Framework V2 and above | |
// Base32 code adapted from http://stackoverflow.com/questions/641361/base32-decoding | |
// Usage:: | |
// From the url otpauth://totp/Google%3A{YOUR-EMAIL}?secret={YOUR-SECRET}&issuer=Google | |
// string base32secret = "{YOUR-SECRET}"; | |
// string pin = Totp.GeneratePin(base32secret, 30, 6); | |
using System; | |
using System.Globalization; | |
using System.Security.Cryptography; |