Uma das perguntas mais comuns entre desenvolvedores iniciantes ou que ainda estão em fase de estudos, é:
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
protected String encrypt(String token) throws Exception { | |
// Instantiate the cipher | |
final SecretKeySpec key = new SecretKeySpec("oldhouse".getBytes("ISO-8859-1"), "DES"); | |
AlgorithmParameterSpec paramSpec = new IvParameterSpec("houseold".getBytes()); | |
Cipher cipher = Cipher.getInstance("DES/CFB8/NoPadding"); | |
cipher.init(Cipher.ENCRYPT_MODE, key, paramSpec); | |
byte[] binaryData = cipher.doFinal(token.getBytes("ISO-8859-1")); | |
return new String(org.apache.commons.codec.binary.Base64.encodeBase64(binaryData), "ISO-8859-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
#!/usr/bin/python | |
# Rewrite URL Script for Secure Web Issue | |
# author: Kaan Yamanyar | |
from Crypto.Cipher import DES | |
from datetime import datetime, timedelta | |
import sys | |
import re | |
import base64 | |
def parseToken(str): |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
</head> | |
<body> |
NewerOlder