Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Monday, January 26, 2015

crypto-013, exam 1, question 7

Question 7

Suppose you are told that the one time pad encryption of the message "attack at dawn" is 6c73d5240a948c86981bc294814d (the plaintext letters are encoded as 8-bit ASCII and the given ciphertext is written in hex). What would be the one time pad encryption of the message "attack at dusk" under the same OTP key?

Wednesday, May 18, 2011

Tiny clients to consume Web Services. (PHP, WinPoSh, Python, Ruby)

PHP:
$wsClient = new SoapClient('http://server/webapp/path/to/webservice');
$ResultHolder = $wsClient->RemoteOperation();

WinPoSh:
PS C:\> $wsClient = New-WebServiceProxy -Uri http://server/webapp/path/to/webservice
PS C:\> $wsClient | Get-Member
PS C:\> $wsClient.RemoteOperation()

Python:

import sys
from SOAPpy import WSDL

WSDLFILE = 'http://server/webapp/path/to/webservice'
_client = WSDL.Proxy(WSDLFILE)

result_holder = _client.RemoteOperation()

Ruby:
require 'savon'
# create a client for the service
client = Savon.client(wsdl: 'http://server/webapp/path/to/webservice')
print client.operations
# => [:find_user, :list_users]
# call the 'remoteOperation' operation
#response = client.call(:remote_operation, message: { id: 1 })
#response.body
# => { remote_operation_response: { id: 1, otherfield: 'Foo Bar' } }

Friday, March 26, 2010

A tiny python Google results opener

#googleopener10.py
#A tiny python Google results opener.
#MAR2010



import sys
import urllib
import urllib2
import re
import os