我工作的组织使用PPolicy(OpenLDAP模块)来自动加密和散列密码.不幸的是,我无法访问运行OpenLDAP服务器的机器,所以我无法查看配置文件.从我所看到的,几乎所有东西似乎都使用默认设置进行设置.
我希望能够为特定用户检索salt.如果我查看用户的属性,userPassword是SSHA密码.我没有看到任何有关该特定用户的盐的信息.我最终查看了LDAP模式,我也没有看到任何关于盐的信息.
如果您猜测每个用户存储盐的位置,它会在哪里?我理解这是模糊的,可能不是很多信息,但我在OpenLDAP文档中找不到任何解释确切存储唯一盐的位置.也许之前配置过OpenLDAP服务器的人会知道默认位置在哪里.
谢谢.
对于我的生活,我似乎无法在任何地方找到这个,如果有人甚至可以给我一个链接,我会非常感激.
我们正试图在openLDAP中启用SSHA哈希.默认情况下,它以明文形式存储密码,我认为这是犯罪行为,但是嘿,我是AD的家伙,所以我知道什么.但是如果您愿意的话,您会认为它们可以让您轻松找到打开哈希所需的信息.你不会选择吗?
我正在为邮件服务器开发一个Web管理模块(如果你想看一下,它是开源的).
为此,我需要能够生成Dovecot可读的散列密码.如他们的wiki所述,他们推荐的密码哈希方案是SSHA256(额外的S用于盐渍).
它还解释说,使用类似PHP代码的方法实现这一点可能相当简单:
$salt = 'generate_a_salt_somehow';
$hash = hash('sha256', $password . $salt);
Run Code Online (Sandbox Code Playgroud)
然而,从我所读到的关于密码学的内容来看,这是一种生成盐渍哈希的相当天真的方法,但是如果你在源代码中输入AES时做错了,我认为在这种情况下也是如此.
因此,如果你对密码学有所了解,我很想知道最安全的方法,无论是mcrypt,mhash还是其他什么.
我有一个使用 REST 服务进行 LDAP 身份验证的项目。我的 LDAP 配置具有 Salted SHA (SSHA) 密码哈希方法。在 Spring 的支持 SHA 方法的 LDAP 身份验证最佳实践指南中,当我使用该方法时,我得到了错误的凭据,而凭据却正常。
我的配置类参考:
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userSearchFilter("uid={0}")
.contextSource(contextSource())
.passwordCompare()
.passwordEncoder(new LdapShaPasswordEncoder())
.passwordAttribute("userPassword");
}
@Bean
public DefaultSpringSecurityContextSource contextSource() {
return new DefaultSpringSecurityContextSource(Arrays.asList("ldap://localhost:8389/"), "dc=springframework,dc=org");
}
}
Run Code Online (Sandbox Code Playgroud)
我的 ldif 配置;
dn: uid=ben,ou=people,dc=springframework,dc=org
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
cn: Ben Alex
sn: Alex
uid: ben
userPassword: {SSHA}pcFdFhO/NS98EhTRup60PMkHMWFRDkJ3jUu1Zg==
Run Code Online (Sandbox Code Playgroud)
我原来的密码是Test1234. 我的pom.xml …
我想在ssha中加密密码。存在一种方法吗?我找到了,但是在sha。
private String encrypt(final String plaintext) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e.getMessage());
}
try {
md.update(plaintext.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e.getMessage());
}
byte raw[] = md.digest();
String hash = (new BASE64Encoder()).encode(raw);
return hash;
}
Run Code Online (Sandbox Code Playgroud) ssha ×5
hash ×2
java ×2
openldap ×2
salt ×2
cryptography ×1
encryption ×1
passwords ×1
php ×1
sha1 ×1
spring ×1
spring-ldap ×1