Extract .dir.yaml encryption to method