On Learning and Recognition of Secure Patterns