标签: encryption

我的算法的加密分析

import string,random,platform,os,sys
def rPass():
    sent =  os.urandom(random.randrange(900,7899))
    print sent,"\n"
    intsent=0
    for i in sent:
        intsent += ord(i)
    print intsent
    intset=0
rPass()
Run Code Online (Sandbox Code Playgroud)

我需要帮助确定该算法的字节码部分的总可能输出.不要担心for循环和用于下线的ord东西. - 新手加密的家伙.

python encryption complexity-theory cryptography python-2.7

-1
推荐指数
1
解决办法
193
查看次数

Caesar Cipher简单程序

我从这里获取了一个简单的Caesar密码的代码,我修改了它,以便用户定义密钥.但每次我试图运行程序时程序都会崩溃.

#include <stdio.h>

int main() 
{
    char array[100], cipher[100];
    int c=0, x=0, y=0;
    int z;
    printf("This Program will encrypt according to your needs\n");
    printf("Enter the cipher key\n");
    scanf("%d",&z);
    printf("Enter the sentence");
    while((c=getchar()) != '\n')
    {
        array[x++]=(char)c;
        cipher[y++]=(char)(c+z);
    }

    array[x]=0;
    cipher[y]=0;

    printf("%s\n",cipher);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c encryption

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

哈希密码.安全?

我没有要发布的代码,因为这只是一个普遍的问题.

我目前有一个网站,我有身份验证设置.我有网站的成员,我将他们的凭据存储在数据库中.这完全没问题.常识适用于此,我知道我不应该将用户信息存储为纯文本.然而,当我研究的时候,我看到哈希字符串很容易做到.在整个开发过程中,我发现还有一种方法可以解密这些密码,从而引发了我的这个问题.只是哈希密码吗?我应该和它一起做某种加密吗?什么是最佳做法?我没有在网上找到任何好的信息......

string dec = FormsAuthentication.HashPasswordForStoringInConfigFile(Login1.Password, "SHA1"); 提前感谢任何有用的输入.

c# security authentication encryption

-1
推荐指数
1
解决办法
85
查看次数

无法将sql连接字符串转换为byte []

我试图转换包含普通字符和'_',';'和'='的sqlstring,当我尝试这样做时:

Byte[] byt = Convert.FromBase64String(value);
Run Code Online (Sandbox Code Playgroud)

我收到此错误消息

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

Additional information: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
Run Code Online (Sandbox Code Playgroud)

Additonal: - 我用它来加密sqlstring -my解密,它使用同样的功能工作正常,但在尝试转换回加密时失败

c# sql encryption cryptography bytearray

-1
推荐指数
1
解决办法
683
查看次数

存储密码时为什么要使用salt而不是AES

与使用salt相比,AES在将密码存储到数据库时不会更安全地保护密码.注意:不关心性能,只关心安全性.哪一个会更安全.此外,将加密密钥存储在另一个数据库服务器中的加密显然不是更好.

mysql encryption hash salt password-protection

-1
推荐指数
1
解决办法
310
查看次数

如果密码散列可以轻松解密,有什么用?

密码是mySQL数据库应该以散列形式保存

echo password_hash('test', PASSWORD_BCRYPT); 
Run Code Online (Sandbox Code Playgroud)

给我们

$2y$10$8PxsFGPbGtgYb44GRPL84ev2T0xR0LXMSSKm7cuSBUbAU114mosFG 
Run Code Online (Sandbox Code Playgroud)

要么

$2y$10$E.q3bVE9EE2ce2VaKPJgtuwEMRZxpTYiQR6Mw2dmLGqeKx/PsQY42 
Run Code Online (Sandbox Code Playgroud)

要么 ...

但是所有这些$2y$10. . .字符串都很容易被解密回test使用password_verify.

假设某人可以访问哈希密码,那么她将能够使用password_verify ?解密它们?一旦有人拥有字符串,$2y$10$E.q3bVE9EE2ce2VaKPJgtuwEMRZxpTYiQR6Mw2dmLGqeKx/PsQY42他或她就可以轻松地将其转换回纯文本,对吧?那么为什么要使用密码呢?

php mysql encryption hash

-1
推荐指数
1
解决办法
2184
查看次数

在不超出数组范围的情况下获取IndexOutOfRangeException

所以我有下面的代码使用orgTxt和创建一个加密的字符串rndTxt,当我在Visual Studio中调试代码时,我在第二个for循环中得到IndexOutOfRangeException的错误.

我用断点检查索引的值,它似乎完全在范围内,任何人都知道问题是什么?如果需要更多信息来帮助解决此错误,请留下评论.

//variables
    string scrtTxt = null;
    string rndTxt = null;
    string orgTxt = reader.ReadToEnd();

//assigning random a string from key (set of all capital letters) to rndTxt
for (int i = 0; i < fileInfo.Length; i++) 
        {
             rndTxt += key[random.Next(0, key.Length)]; 
        }

//generating the encrypted message scrtTxt
 int j = 0;
 for (int i = 0; i < fileInfo.Length; i++)
       {
            if ((orgTxt[i] + rndTxt[j] - 'A') <= 'Z' && (orgTxt[i] + …
Run Code Online (Sandbox Code Playgroud)

c# encryption indexoutofboundsexception

-1
推荐指数
1
解决办法
82
查看次数

使用sha256managed解密哈希

好吧,一周前我开始使用c#,我有点困惑.

我从加密开始,基本上是哈希和盐.

我的老师给了我们这个周末做的"功课",我和我的所有伙伴都非常困惑.

我有这个简单的代码:

练习包括"解密"散列密码(使用SHA256managed进行哈希处理),我们知道它是一个4个字符的数字.

我尝试使用循环并逐个解密所有字符,但我卡住了,我不知道如何继续.

如果你能帮助我,我真的很感激.

谢谢!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
using System.IO;

namespace Examen
{
    class Program
    {
        static void Main(string[] args)
        {

            string hashed_password = "YOSGtSkJ41KX7K80FEmg+vme4ioLsp3qr28XU8nDQ9c=";



            Console.ReadLine();
        }


    }
}
Run Code Online (Sandbox Code Playgroud)

c# encryption hash

-1
推荐指数
1
解决办法
8155
查看次数

将字符串解密为数字

上周,我被指派将数字PIN加密成可发音的字符串(由元音 - 辅音对组成).这很顺利.

本周,我被指派将我的功能产生的字符串解密回原始的PIN表格.我正在尝试对我的代码进行反向工程,但我不知道从哪里开始.

全局变量:

CONSONANTS = "bcdfghjklmnpqrstvwyz" 
VOWELS = "aeiou" 
Run Code Online (Sandbox Code Playgroud)

加密代码:

def alphapinEncode(pin):
    '''(num) -> string
    Takes user input (pin) and converts it into a pronounceable string.
    Returns the string (codedPin)

    Examples:
    >>> alphainEncode(4327)
    'lohi'
    >>> alphainEncode(3463470)
    'bomejusa'
    '''

    codedPin = ""

    while pin > 0:
        last_two_digits = pin % 100
        codedPin = VOWELS[last_two_digits % 5] + codedPin
        codedPin = CONSONANTS[last_two_digits // 5] + codedPin
        pin = pin // 100

    return codedPin
Run Code Online (Sandbox Code Playgroud)

解密代码:

def alphapinDecode(codedPin):
    '''(string) -> …
Run Code Online (Sandbox Code Playgroud)

python encryption python-3.x

-1
推荐指数
1
解决办法
271
查看次数

为什么Windows哈希密码?

有许多操作系统和程序可以使用密码进行身份验证.即使他们可以用许多不同的方式加密密码并保存它们为什么要保存它们的哈希?加密它们的问题唯一的原因可能是破坏和解密它们还是有其他原因?感谢您提前回答

windows encryption hash

-1
推荐指数
1
解决办法
40
查看次数