[20160420]shadow文件格式口令加密.txt

[20160420]shadow文件格式口令加密.txt

$ man 5 shadow
SHADOW(5)                File Formats and Conversions                SHADOW(5)

NAME
       shadow - encrypted password file

DESCRIPTION
       shadow contains the encrypted password information for user's accounts and optional the password aging
       information. Included is:

       . login name
       . encrypted password
       . days since Jan 1, 1970 that password was last changed
       . days before password may be changed
       . days after which password must be changed
       . days before password is to expire that user is warned
       . days after password expires that account is disabled
       . days since Jan 1, 1970 that account is disabled
       . a reserved field

# cat /etc/shadow |grep oracle
oracle:$1$ZcwH7AWX$0BlZZRahwsQ4hLIEUTBN5.:16911:0:99999:7:::

--主要关注加密字段.
$1$ZcwH7AWX$0BlZZRahwsQ4hLIEUTBN5.

--以$作为分割,

--第1个字段表示:

$1 = MD5 hashing algorithm.
$2 =Blowfish Algorithm is in use.
$2a=eksblowfish Algorithm
$5 =SHA-256 Algorithm
$6 =SHA-512 Algorithm

--很明显这里使用MD5 hashing algorithm.

--第2个字段salt占8位:
ZcwH7AWX

--第3个字段就是口令的加密串=> password+slat的hash value.
0BlZZRahwsQ4hLIEUTBN5.

--我的测试口令是123456,测试看看:

$ openssl passwd -1 -salt ZcwH7AWX 123456
$1$ZcwH7AWX$0BlZZRahwsQ4hLIEUTBN5.

--正好对上!!

--实际上在安装的时候可以选择口令的加密算法.
# grep password /etc/pam.d/system-auth
password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    required      pam_deny.so

# authconfig --test|grep hashing
password hashing algorithm is md5

# authconfig --passalgo=sha512 --update

# grep sha512 /etc/pam.d/system-auth
system-auth:password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok
system-auth-ac:password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok
--已经修改为sha512

时间: 2024-08-01 10:43:09

[20160420]shadow文件格式口令加密.txt的相关文章

[20170329]还原用户口令信息.txt

[20170329]还原用户口令信息.txt --//上午在例行检查中发现发现sys.aud$增加异常. col object_name format a40 col owner format a40 prompt 日期1 日期2 显示行数 SELECT *   FROM (  SELECT dhso.OWNER                 ,dhso.object_name                 ,object_type                 ,SUM (db_bloc

快速搞懂Android口令加密(一)_Android

废话不多说了,直接给大家贴代码了. import java.util.Random; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; public class Token { /* * 基于口令

[20171101]修改oracle口令安全问题.txt

[20171101]修改oracle口令安全问题.txt --//等保的问题,做一些关于修改oracle口令方面的测试. 1.oracle修改口令一般如下方式: alter user scott identified by oracle; password scott 第三方工具,通常也是执行以上类似的命令.我使用SQL Tracker(toad自带的工具)测试,实际上执行的也是第1种方式. 2.测试: --//我自己曾经建立一个脚本(我修改加入包含alter的内容): # cat -v Tcp

[20140408]db link 口令安全问题.txt

[20140408]db link 口令安全问题.txt 测试在11GR2 ,如果以sys用户登录,查询sys.link$基表,通过简单的函数很容易知道db link的口令. 例子: SYS@test> @ver BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.3

快速搞懂Android口令加密(一)

废话不多说了,直接给大家贴代码了. import java.util.Random; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; public class Token { /* * 基于口令

求各位亲们解答,关于C#加密txt文件的一些问题

问题描述 想用C#实现txt文件的移动加密,txt经过加密之后生成一个exe文件,打开时得输入正确的密码才能读取里面的内容,否则拒绝访问,该怎样实现这功能呢?我是想着加密后把密文存进一个txt文件,然后和加密目标txt文件一起放进一个exe文件,访问的通过读取密文进行匹配验证,请问这个外壳exe(即父程序)怎样读取子程序exe里面那个放着密文的txt和加密目标txt文件呢? 解决方案 解决方案二:不知道,希望你能解决解决方案三:不谈加密,谈一谈制作一个自我捆绑exe的思路.我们估算一个exe的长

登录口令加密函数、用户登录主Form实现方法和具体代码

函数|加密 create函数PWD: create FUNCTION PWD(sdpassword varchar2) RETURN varchar2 IS    len   number;    szpwd varchar2(20);  BEGIN     len:=length(sdpassword);     for i in 1..len loop       szpwd:=szpwd||                   chr(ascii(substr(sdpassword,i,1

.NET中带有口令加密的注册页面

加密|页面 在ASP.NET中提供了加密的功能.名字空间System.Web.Security中包含了类FormsAuthentication,其中有一个方法HashPasswordForStoringInConfigFile.这个方法可以将用户提供的字符变成乱码,然后存储起来.注意此方法是不能继承的.下面的代码就是在做注册页面时将数据加密后存储到数据库的过程Imports System.Web.SecurityImports System.DataImports System.Data.Sql

.NET中带有口令加密的注册页面(还是发表在这里吧~-~)

加密|页面 在ASP.NET中提供了加密的功能.名字空间System.Web.Security中包含了类FormsAuthentication,其中有一个方法HashPasswordForStoringInConfigFile.这个方法可以将用户提供的字符变成乱码,然后存储起来.注意此方法是不能继承的.下面的代码就是在做注册页面时将数据加密后存储到数据库的过程Imports System.Web.SecurityImports System.DataImports System.Data.Sql