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
uses | |
Windows, SysUtils; | |
function GeraDigitosAleatorios(tamanho: Integer): String; | |
type | |
TBCryptGenRandom = function(hAlgorithm: THandle; pbBuffer: PUCHAR; | |
cbBuffer, dwFlags: ULONG): ULONG; stdcall; | |
const | |
bcryptdll = 'bcrypt.dll'; | |
STATUS_SUCCESS = $00000000; |
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
Attribute VB_Name = "GeraDigitosAleatorios" | |
Option Explicit | |
Private Declare Function BCryptGenRandom Lib "bcrypt.dll" (ByVal hAlgorithm As Long, ByRef pbBuffer As Long, ByVal cbBuffer As Long, ByVal dwFlags As Long) As Long | |
Const BCRYPT_USE_SYSTEM_PREFERRED_RNG = &H2 | |
Const STATUS_SUCCESS = &H0 | |
Public Function GeraDigitosAleatorios(ByVal tamanho As Integer) As String | |
Const ERRO_GERACAO_SEQUENCIA_NUMERO = vbObjectError + 1 |
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
Imports System.Text | |
Imports System.Security.Cryptography | |
Module VBModule | |
Sub Main() | |
Console.WriteLine(GeraDigitosAleatorios(8)) | |
End Sub | |
Function GeraDigitosAleatorios(ByVal tamanho As Integer) As String |
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.Security.Cryptography; | |
public class Program { | |
public static void Main() { | |
Console.WriteLine(GeraDigitosAleatorios(8)); | |
} | |
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
SELECT | |
RIGHT(ABS(CAST(CRYPT_GEN_RANDOM(str_size) AS BIGINT)), str_size) crypto_rand | |
FROM | |
(select 8 str_size) var; -- "8" é o tamanho da string a ser gerada |
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
-- Para executar esse código é necessário ter acesso ao pacote DBMS_CRYPTO | |
-- GRANT EXECUTE ON SYS.DBMS_CRYPTO TO <seu_usuario>; | |
SELECT | |
LPAD(DBMS_CRYPTO.RANDOMNUMBER, str_size, '0') crypto_rand | |
FROM | |
(SELECT 8 str_size FROM dual); -- "8" é o tamanho da string a ser gerada |
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
import java.security.SecureRandom; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
System.out.println(GeraDigitosAleatorios(8)); | |
} | |
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
# -*- coding: utf-8 -*- | |
# requires python-ldap (usually pip install python-ldap) | |
# But this package requires OpenLDAP libraries, so it is a pain to install it on Windows. | |
# So, if you're on Windows, I recomment to use pre-compiled binaries with this command (virtualenv supported): | |
# pip install https://download.lfd.uci.edu/pythonlibs/h2ufg7oq/python_ldap-3.1.0-cp37-cp37m-win_amd64.whl | |
import ldap | |
from ldap.controls import SimplePagedResultsControl |
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
# -*- coding: utf-8 -*- | |
# RunMe.Py | |
# 2018 - Diego Queiroz | |
# | |
# Usage: | |
# Linux : python /path/to/RunMe.py /path/to/your/your_script.sh | |
# Windows: C:\path\to\python.exe C:\path\to\RunMe.py C:\path\to\your_script.bat | |
# | |
import atexit |
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
#!/bin/bash | |
# Baixa a senha do cartão Nubank | |
# Uso: | |
# ./nubank_password.sh <cpf> <senha> | |
cpf=$1 | |
senha=$2 | |
if [ "$cpf" == "" ]; then | |
read -p "Digite o CPF: " cpf |
NewerOlder