#!/usr/bin/perl -w # # Demo script accompanying TD09 presentation # Developing and Deploying Securely # # This script is for the Crypto Framework portion of the talk # $prompt = "[global 1]: \$"; # $prompt = "\$"; #-------------------------------------------------- sub command { printf ("$prompt "); system ("typer \"$pcmd\""); system(wait4enter); system($xcmd); printf("$prompt ") ; system(wait4enter); } #-------------------------------------------------- # main # slide 40 system(clear); $pcmd="cryptoadm list"; $xcmd=$pcmd; command(); # slide 45 system(clear); $pcmd="man pkcs11_softtoken"; $xcmd=$pcmd; command(); # slide 47 digest example system(clear); $pcmd="digest -l"; $xcmd=$pcmd; command(); printf("\n"); $pcmd="digest -a sha256 /etc/passwd"; $xcmd=$pcmd; command(); # slide 47 - encryption example system(clear); $pcmd="encrypt -l"; $xcmd=$pcmd; command(); printf("\n"); $pcmd="pktool genkey keystore=file keytype=aes keylen=192 outkey=key"; $xcmd=$pcmd; command(); printf("\n"); $pcmd="encrypt -k key -a aes -i /etc/passwd -o passwd.enc"; $xcmd=$pcmd; command(); printf("\n"); $pcmd="od -xc passwd.enc \| head"; $xcmd=$pcmd; command(); # slide 49 system(clear); $pcmd="modinfo \| grep -i swrand"; $xcmd=$pcmd; command(); printf("\n"); $pcmd="cryptoadm list -mv"; $xcmd=$pcmd; command(); #--------------------------------------------------