Sina: key algorithm #298

Implemented the key algorithm in #298.

Related issues: #246 #281