小编Fey*_*ubi的帖子

硬件令牌设备如何工作?

最近,我的银行发给我这个小设备,它生成一个必须在执行在线交易时使用的唯一代码,当我按下一个特定的白色按钮时,所有设备都会生成这个唯一的代码,它看起来不像是连接到一个远程服务器或其他任何东西.

我做了一些研究,最后在密码学中使用了一种称为Hash函数的东西,但我仍然没有得到它.

我的问题

  • 我银行的服务器如何知道该设备生成的代码是否正确?
  • 由于它每30秒只生成五个随机数字,为什么服务器不会验证我还决定使用的随机数?

hash cryptography hmac one-time-password two-factor-authentication

30
推荐指数
1
解决办法
4万
查看次数

如何实现Observer以从侦听器获取数据?

我正在使用MaterialDrawer库为我的应用程序创建一个简单的抽屉,库中的一些类实例需要在调用时传递给它们的字符串.一个例子是这个IProfile类:

IProfile profile = new ProfileDrawerItem().withName("John Doe");

其中withName()方法接受的字符串.

我已经创建了一个类MyObservable.java(扩展Observable)类,我打算用它来获取要在我MainActivity实现MaterialDrawer库的数据.在这个类中,我有一个方法implementData(),它可以从我的firebase数据库中获取我需要的内容.

这就是它的样子:

    public class MyObservable extends Observable {

    // Attach our firebase reference...
    Firebase userRef = new Firebase("https://myApp.firebaseio.com/users");
    AuthData authData;

    public String username = "";
    public String email = "";


    public void changeUsername(String username) {
        this.username = username;

        setChanged();
        notifyObservers(username);
    }


    public void implementData(){
        // Get the authentication data of our user from the reference.
        authData = userRef.getAuth();

        // This …
Run Code Online (Sandbox Code Playgroud)

java android observable observer-pattern firebase

7
推荐指数
1
解决办法
2万
查看次数

通过Varnish/Apache在Wordpress上使用Nginx SSL终止重定向循环

我有一个设置,其中Apache在端口80上的Varnish 4后面监听端口8080,但是我的客户端需要ssl在网站上工作,因此我使用本指南在端口443上设置Nginx用于SSL终止.

一切都在http上工作正常,但是在尝试在https上加载网站时,网站所需的脚本将无法加载,所以我决定将网站网址更改为Settings > Generalhttps网址,保存更改后,我获得了重定向Chrome中的循环错误.

我无法访问该网站的wordpress仪表板来更改网址,所以我必须通过phpmyadmin这样做.但是现在当通过https访问该站点时,站点中断导致呈现内容所需的脚本未经过身份验证.

其他人在这里有同样的问题,但看起来并没有解决.

如何https在Chrome中没有重定向循环的情况下启用该网站?

apache wordpress nginx varnish ubuntu-14.04

3
推荐指数
1
解决办法
2664
查看次数

Apollo客户端在向服务器发送突变时返回“ 400(错误请求)错误”

我目前正在为Apollo客户端使用vue-apollo包,并为我的GraphQl API使用带有django和graphene-python的VueJs堆栈。

我在下面用vue-apollo进行了简单的设置:

import Vue from 'vue'
import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'
import VueApollo from 'vue-apollo'
import Cookies from 'js-cookie'


const httpLink = new HttpLink({
  credentials: 'same-origin',
  uri: 'http://localhost:8000/api/',
})

// Create the apollo client
const apolloClient = new ApolloClient({
  link: httpLink,
  cache: new InMemoryCache(),
  connectToDevTools: true,
})

export const apolloProvider = new VueApollo({
  defaultClient: apolloClient,
})

// Install the vue plugin
Vue.use(VueApollo)
Run Code Online (Sandbox Code Playgroud)

我还settings.py …

django apollo vue.js graphql graphene-python

2
推荐指数
2
解决办法
4814
查看次数

如何在此vb应用程序中传递变量的结果?

我已经编写了下面的代码来计算大于或等于1的数字的阶乘.

Public Class FactorialApp

    Private Function FactorialChecker(myNumber As Integer)
        myNumber = Val(FactorialTextBox.Text)
        If myNumber < 1 Then
            FactorialChecker = 1

        Else
            FactorialChecker = myNumber * FactorialChecker(myNumber - 1)
        End If
    End Function

    Public Sub ResultButton_Click(sender As Object, e As EventArgs) Handles ResultButton.Click

    End Sub

End Class
Run Code Online (Sandbox Code Playgroud)

我希望在一个button_click事件中有一个消息框,其中有一个类似于5的阶乘是点击时应该是5的120myNumber和120的FactorialChecker()函数,但是我不知道如何在VB的MsgBox命令中返回值,我只是习惯了C#的.

我尝试了代码片段

    MsgBox("The Factorial of  + myNumber "is" + FactorialChecker() "") 
Run Code Online (Sandbox Code Playgroud)

但是我被visual studio中的语法错误所困,还有一个错误,即我的myNumber变量未在程序中声明.我该怎么办才能解决这些错误?

vb.net msgbox

0
推荐指数
1
解决办法
90
查看次数