密码保护的网站使用JavaScript密码保护、网站、JavaScript

2023-09-11 23:05:06 作者:闷着i

我有一个quetion这可能是简单的/哑或不:)。换句话说,我不知道,如果是不够公平或完全愚蠢的想法。只是一些免费的想法。

I have a quetion which may be simple/dumb or not :). In other words I have no idea if is fair enough or a completely foolish idea. Just some free thoughts.

如果我让我的登录通过JavaScript与通过它(是的,我知道),但通过将安全散列算法来hased。例如:

What if I make my login via JavaScript with pass in it (yes I know), but pass will be hased by Secure Hash Algorithm. For instance:

我产生了一通与SHA它看起来像

I generate a pass with SHA which looks like

var = 0xc1059ed8... //etc

和粘贴到code。会有也两种功能。一个将两个值进行比较(由我与用户给出)和第二会产生SHA形式的用户输入。

and paste into the code. There will be also two functions. One will compare two values (given by me with user's) and second will generate sha form user's input.

这可能是安全的theoritically或者这是一个可怕的图案和愚蠢的想法?可以JS处理呢?

Is this could be safe theoritically or this is a horrible pattern and stupid idea? Can JS handle it?

编辑:我不是故意的严重autentication如银行之一。正当我有我的图片,并希望只有几个PPL看他们的,地上的脂肪酶的99.9%,不能看他们:) THX的响应

I didn't mean serious autentication like banking one. Just when I have my pics and want only to a few ppl to watch them and 99,9% of ppl on earth can't watch them :) thx for responses

推荐答案

对不起,没有骰子:)安全认证是不可能的,客户端Javascript独自一人,因为一个积极的鉴定结果可能是假的。你会的总是的需要一个服务器端的实例来验证。

Sorry, no dice :) Secure authentication is not possible with client-side Javascript alone, because a positive authentication result could be faked. You will always need a server-side instance to authenticate against.

 
精彩推荐