Better searching for used encryption types

- Adapted to @jreidinger's idea using new function