update encryption sample to v5

fixes #263
fixes #47