When using kencrypt with -h5 in combination with -infile everything works perfectly. e.g:
kencrypt -h5 -in=tour.min.xml -out=tour.min.xml
However, if I just set an input file, the resulting file is different and invalid for the HTML5 viewer. e.g:
kencrypt -h5 -ow tour.min.xml
I imagine this might be some problem in the option parsing which causes kencrypt to ignore -h5 in the second case.