Пример #1
0
        public string GetLoginBase64(int userId)
        {
            string        privateKey = Encoding.UTF8.GetString(Resources.privatekey);
            RSAParameters p          = RSAHelper.ConvertFromPemPrivateKey(privateKey);
            string        start      = "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00";
            string        end        = "010101010101010101010101010101010101010101010101010101010101010155914510010403030101";
            string        id         = start + userId.ToString("X8") + end;
            int           l          = id.Length;

            byte[] bufId   = (new BigInteger(id, 16)).getBytes();
            byte[] mm      = DataTranslate.HexStringToByte(id);
            byte[] bufCode = RSAHelper.RsaDecrypt(mm, p.D, p.Modulus);
            string base64  = Convert.ToBase64String(bufCode);

            return(base64);
        }