Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


fko python module version 1.0

This module is essentially a Python wrapper for the Firewall Knock
Operator library, "libfko".  See the "libfko" documentation for
additional information on the functionality provided by "libfko"
and usage overview.

Before attempting to build this module, libfko needs to be installed on
the system.

To build and install the module:

   * Build with "python build"
   * Install with "python install"

Simple usage example:

# Import the Fko class and all constants.
from fko import *

# Create an Fko instance with an empty context.
fko = Fko()

# Set the HMAC digest algorithm

# Set the SPA message (Note: Access request is default if not specified).

# Create the final SPA data message string.
fko.spa_data_final("mypassword", "myhmackey")

# print the spa message.
print fko.spa_data()

(prints something like this):

# To decode SPA data:
fko = Fko("/m4fc/3OGd1IOchWM8o/yUvoa8TdbsRgU0zrp4UWuese9DIcHl09pZ3ukrNy/2OZAH3gnRH186YVMQEB1qfx23xVMq3IXx/fBwxgLBIqNdii2yWGqUVlxw83tfiP/p3Fmr7AeM1mev62xpE8R5vdACNxIDMM51lmYKh6JtEMoHrXXFAIRqbwCXJvlTEQij4vlZ4KfhMpnxxiiUciDWB11mbVDGSsQqKU9MQ", "mypassword", "myhmackey")

# Print some of the data:
print "Version:", fko.version()
print "Timestamp:", fko.timestamp()
print "Username:", fko.username()
print "Digest Type (value):", fko.digest_type()
print "Digest Type (string):", fko.digest_type_str()
print "Digest:", fko.spa_digest()
print "SPA Message:", fko.spa_message()
Something went wrong with that request. Please try again.