0

we have a mobile APP and want to embed a PC page,for example: www.XXX.com

But we need member has logined in this page.

So we can build this urlwww.XXX.com?token=XXXXXXX

So the token can't be plaintext and must be encrypted,so I use a aes gem

I encrypt one member id to oDk6N21+t26f1PbvwIHtNw==$ZO319ZlmjsOMTzh+sF/hHg==

So the url turns to be www.XXX.com?token=oDk6N21+t26f1PbvwIHtNw==$ZO319ZlmjsOMTzh+sF/hHg==

Now the question is come.

I try to get the token value ,but I get oDk6N21 t26f1PbvwIHtNw==$ZO319ZlmjsOMTzh sF/hHg==

Some character has been replaced,so how can I get the original token?

0

1 Answer 1

-1

It seems to be straightforward:

# generate random key
key = AES.key

# encrypting your message
encr = AES.encrypt "my message", key

# decrypt later with the same key
AES.decrypt encr, key # => "my message"

The full documentation is here.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.