示例#1
0
int main(int argc, char *argv[])
	{
	DES_cblock k,k1;
	int i;

	TINYCLR_SSL_PRINTF("read passwd\n");
	if ((i=des_read_password(&k,"Enter password:"******"password = "******"%02x ",k[i]);
		}
	else
		TINYCLR_SSL_PRINTF("error %d\n",i);
	TINYCLR_SSL_PRINTF("\n");
	TINYCLR_SSL_PRINTF("read 2passwds and verify\n");
	if ((i=des_read_2passwords(&k,&k1,
		"Enter verified password:"******"password1 = ");
		for (i=0; i<8; i++)
			TINYCLR_SSL_PRINTF("%02x ",k[i]);
		TINYCLR_SSL_PRINTF("\n");
		TINYCLR_SSL_PRINTF("password2 = ");
		for (i=0; i<8; i++)
			TINYCLR_SSL_PRINTF("%02x ",k1[i]);
		TINYCLR_SSL_PRINTF("\n");
		TINYCLR_SSL_EXIT(1);
		}
	else
		{
		TINYCLR_SSL_PRINTF("error %d\n",i);
		TINYCLR_SSL_EXIT(0);
		}
#ifdef LINT
	return(0);
#endif
	}
示例#2
0
文件: rpw.c 项目: 274914765/C
int main (int argc, char *argv[])
{
    DES_cblock k, k1;

    int i;

    printf ("read passwd\n");
    if ((i = des_read_password (&k, "Enter password:"******"password = "******"%02x ", k[i]);
    }
    else
        printf ("error %d\n", i);
    printf ("\n");
    printf ("read 2passwds and verify\n");
    if ((i = des_read_2passwords (&k, &k1, "Enter verified password:"******"password1 = ");
        for (i = 0; i < 8; i++)
            printf ("%02x ", k[i]);
        printf ("\n");
        printf ("password2 = ");
        for (i = 0; i < 8; i++)
            printf ("%02x ", k1[i]);
        printf ("\n");
        exit (1);
    }
    else
    {
        printf ("error %d\n", i);
        exit (0);
    }
#ifdef LINT
    return (0);
#endif
}