[mod] refactored pk crypto into separate file